Authentication¶
PrairieLearn currently uses Google OAuth 2 as its only supported method of user authentication for self-hosted PrairieLearn instances. While LTI 1.1 is also available, it is currently deprecated and should be avoided for new deployments. LTI 1.3 is supported for interoperability with learning management systems, but not as an authentication method.
SAML and Azure authentication
Authentication using SAML or Azure are available only as enterprise features, and are not supported in self-hosted PrairieLearn instances. If you are interested in these features, please visit https://www.prairielearn.com for information about paid hosting and enterprise support.
Google OAuth 2¶
To start, create a Google Cloud account and then:
- Click console to log in to your console.
- Create a project then go 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:
{
"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.