Submit a ticket My Tickets
Welcome
Login

Using OAuth 2 With Okta

Overview

If your organization has an Okta account, you may use it to authenticate users in your Moodle site as well with Moodle's built-in OAuth2 capabilities. To do so, you will need to register your Moodle site as an application in Okta and then configure your Moodle site to allow users to login with their Okta credentials.

 

Part 1: Setting up Okta

  1. From the Okta Organization Dashboard, Click Application
  2. Select Create App IntegrationPicture of Okta Applications Menu showing Create App Integration button

  3. Select OIDC- OpenID Connect under Sign-in MethodPicture showing Create a new app integration menu with OIDC- OpenID Connect selected

  4. Select Web Application under Application TypePicture showing Create a new app integration menu with  Web Application selected under Application Type

  5. Click Next

  6. Enter the following information into the form:

Setting

Definition

Example

App Integration Name

A name that identifies this as being related to Moodle in Okta.


Moodle US University Moodle


Base URIs

URL of the Moodle Site


https://sam-moodle.moodleus.com


Sign-in Redirect URIs

Base URIs with the following after: /admin/oauth2callback.php



https://sam-moodle.moodleus.com/admin/oauth2callback.php


Sign-out Redirect URIs

Base URIs


https://sam-moodle.moodleus.com



Assignments

Select whether to assign to everyone in your org or only selected group(s)

Allow everyone in your organization to access

Grant Type Allowed

Select Authorization Code Under Client is acting on behalf of a user

N/A

 

New Web App Integration form with example values filled in

  1. Click Save

  2. Copy the following and store them in a safe, accessible place for later

    • Client ID

    • Client Secret

    • Okta Domain

 

Part 2: Configuring Authentication (Moodle)

  1. Login to your Moodle Site

  2. Click Site Administration

  3. Click Server

  4. Click Oauth 2 ServicesMoodle Server Menu with OAuth 2 Services circled

  5. Click Create a new custom serviceMoodle site OAuth 2 Services page with Create a new custom service link circled

  6. Enter the name you want users to see as the Name

  7. Enter the copied Client ID and Client Secret in the boxes labeled Client ID & Client SecretPicture of create a new custom service form with example text filled in for Client ID and Client Secret fields

  8. Enter the Okta domain into the Service base URL then Save changesPicture of create a new custom service form with example text filled in for Service base URL field

 

Part 03: Enabling Authentication

  1. Login to your Moodle Site

  2. Click Site Administration Plugins Manage AuthenticationPicture of Authentication menu with Manage authentication circled

  3. Click the eye icon next to OAuth2Picture of Manage Authentication page with OAuth visible selector (eyeball icon) in turned off state circled

  4. Oauth2 will now be no longer grayed out and appear near the top of the list




Part 04: Testing authentication

  1. Log out of Moodle

  2. Click the newly added Okta button

  3. Log in with your Okta Credentials

  4. Upon initially logging in, you may be asked to confirm your email address through a link sent via email

 

 

 



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.