ClassLink SSO integration with Oauth2 Moodle

Re: ClassLink SSO integration with Oauth2 Moodle

by Leon Stringer -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers

The OAuth 2 issuer, presumably this is Classlink, authenticates the user then redirects the browser to the callback URL in Moodle: admin/oauth2callback.php. This URL must contain two parameters: code and state. These parameters are set by the issuer to be read by Moodle. You've shown that these parameters are being set by Classlink in the URL in your previous reply:

Screenshot of reply with state highlighted: "https://###########/admin/oauth2callback.php?code=...&state=/auth/oauth2/?..."

But this URL shows other parameters – wantsurl, sesskey, id and response_type – which should instead be part of the state parameter.

So:

  1. Classlink are populating the state parameter, you've shown this in your reply.
  2. the other parameters should be URL encoded and appended to the value of the state parameter.

I think Classlink are not setting the state correctly and it's they who need to resolve this.

If I have misunderstood your question please provide more information about what you are trying to do.