Authentication¶
PrairieLearn currently has a few ways to do user authentication.
Google OAuth 2¶
To start, create a Google Cloud account and then:
- Click console to log in to your console.
- Create a project then got to APIs & Services.
- Go to
OAuth consent screenand complete the consent form. - Proceed to
Credentialsand create a newOAuth client ID. - Select
Web application. - Under Authorized JavaScript origins, click
ADD URIand add your domain. - Under Authorized redirect URIs, click
ADD URIand addhttps://yourdomain.com/pl/oauth2callbackwhich is the route to the Google OAuth callback. - Click
Createwhich will give you aClient IDand aClient Secret. Keep these values secret.
- Go to
Now add the keys to config.json:
config.json
{
"googleClientId": "Your Client ID key",
"googleClientSecret": "Your Client Secret key",
"googleRedirectUrl": "https://yourdomain.com/pl/oauth2callback",
"hasOauth": true
}
You should now be able to use Google to log in to your PrairieLearn instance.
LTI¶
Check out the course instance LTI docs to learn more about LTI.