-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
3.11.7, 4.0.1
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
fix/url-in-state
-
-
When trying to use OAuth2 with Microsoft Active Directory Federated Services (ADFS) 2016, I have got issues when the authentication server redirects to Moodle, something like "invalid sesskey" (It's been a few weeks, I found a workaround, see below, but I figured I'd report the issue here anyway).
When logging in, moodle redirects to the ADFS server with a `state` parameter set to something like `/auth/oauth2/login.php?wantsurl=url&sesskey=a&id=1`
However, ADFS 2016 has a bug where it doesn't URL-encode properly the property value, and I have no hope this would ever be fixed.
So instead of
&state=%2Fauth%2Foauth2%2Flogin.php%3Fwantsurl%3Durl%26sesskey%3Da%26id%3D1
|
I have this:
&state=/auth/oauth2/login.php?wantsurl=url&sesskey=a&id=1 |
So now, the state stops with the URL, and the sesskey parameter is outside the state.
My proposal
I know that ADFS is not officially supported, and I know the bug is outside the scope of moodle, but here's my proposal:
Instead of passing the redirect URL, please pass a token or something in the session, that maps to the redirect URL. That way, even poorly-implemented Identity providers could pass the state untouched. It would also help keeping the URL length a bit shorter.
- is blocked by
-
MDL-75064 OAuth2 client should not take a returnurl in the constructor
-
- Development in progress
-