Setup OAuth Client for Internal Services (Django Oauth Toolkit version)



Step-by-step guide

1. Create a new worker user with staff access in LMS (usually <service>-worker)

2. Create 2 different OAuth applications at https://<lms>/admin/oauth2_provider/application/
   

  1.        Client_id: <autogenerated>
           User: select <service> worker that you created with app-permissions
           Redirect Uris: <blank>
           Client type: Confidential
           Authorization grant type: Client credentials
           Client secret: <autogenerated> (not sure if autogenerated is secure enough for prod)
           Name: <service>-backend-service

  2.        Client_id: <autogenerated>
           User: select <service> worker that you created with app-permissions
           Redirect Uris: https://<service_url>/complete/edx-oauth2/
           Client type: Confidential
           Authorization grant type: Authorization code
           Client secret: <autogenerated> (not sure if autogenerated is secure enough for prod)
           Name: <service>-sso
           Skip Authorization: checked

Also see this devstack script for creating the oauth applications.

  1. Add a user_id application access scope for the new <service>-sso app here:
    https://courses-internal.edx.org/admin/oauth_dispatch/applicationaccess
    1. Note: This is handled by the management command in the devstack script and is only needed if doing this manually.
  2. Set the following keys in the configuration settings of your service

Explanation of all the oauth admin pages


Section NameURLDescriptionActively used

Django OAuth Toolkit

/oauth2_provider/Currently used oauth2 provideryes

Oauth_Dispatch

/oauth_dispatch/applicationaccess/This is where we give applications access to certain scopesyes