Problem/Motivation
Microsoft requires the token request includes the resource the token will be used for, see https://stackoverflow.com/questions/23921884/what-is-the-resource-parame...
However, there is currently no option to add a resource parameter to the OAuth2 Client.
Proposed resolution
Allow requesting tokens for a resource that differs from the token endpoint.
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
None.
API changes
hook_oauth2_clients() has a new option resource
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | 3175811-2.patch | 1.47 KB | idebr |
Comments
Comment #2
idebr commentedAttached patch implements a new parameter
resourcethat allows the authorization and token requests to specify a resource that differs from the token endpoint.Comment #3
dashohoxha commentedIs this a standard feature of the OAuth2 protocol? If yes, then it makes sense to apply this patch.
Otherwise, if this is a feature implemented only by the Microsoft servers, and no one else, it makes more sense to implement it as an extension of the module.
For more details see the docs: https://www.drupal.org/docs/8/modules/oauth2-client/oauth2-client-7x-2x#...
Comment #4
idebr commented#3 Yes, resource is a part of the oauth2 specification. It is implemented in the D8 version as
resource_owner_uriin the plugin annotation.Comment #5
dashohoxha commentedIt seems that you are right: https://tools.ietf.org/html/rfc8707
Comment #7
dashohoxha commentedThanks @idebr for reporting it and for the patch.