Submit a ticket My Tickets

Using OAuth 2 With Okta


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 Integration

  3. Select OIDC- OpenID Connect under Sign-in Method

  4. Select Web Application under Application Type

  5. Click Next

  6. Enter the following information into the form




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

Redirect URIs

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

Sign-out Redirect URIs

Base URIs


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

All everyone in your organization to access

Grant Type Allowed

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


  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 Services

  5. Click Create a new custom service

  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 Secret

  8. Enter the Okta domain into the Service base URL

Part 03: Enabling Authentication

  1. Login to your Moodle Site

  2. Click Site Administration

  3. Click Plugins

  4. Click Manage Authentication

  5. Click the eye icon next to OAuth2

  6. 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 in an email sent

Did you find it helpful? Yes No

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