Problem/Motivation
I need to send 'resource' parameter to get Access token.
The request will be sent to https://login.microsoftonline.com//oauth2/token with below parameters
grant_type: client_credentials
resource: https://vhsdev.crm.dynamics.com/
client_id: ****
client_secret: ***
Proposed resolution
I couldn't find a way to add "resource" parameter. The MS Dynamics Oauth API returns invalid access token without resource parameter. Is it possible to add extra parameters before getting Access token?
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | oauth2_client_3256272_extra_options.patch | 1.13 KB | khaldoon_masud |
Issue fork oauth2_client-3256272
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
khaldoon_masud commentedHere is the patch I created.
Plugin definition:
Comment #3
fathershawnComment #4
fathershawnComment #5
fathershawnComment #7
fathershawnThe MR allows additional token request parameters to be added in plugin annotation. These are merged as additional parameters by the GenericProvider class in the League library
So for the OP and others referred by similar issues, please test this MR for your use case.
Comment #10
fathershawnComment #11
fathershawnCleaned up some leakage from another issue
Comment #12
fathershawnComment #14
fathershawnComment #15
fathershawn@zerbash - Thanks for the review. If this revised version works for then I think we are ready to merge. As far as the new MR flow is concerned, instructions are at the top of the issue - just open Show commands details.
If you prefer a patch, just add the extension on to the merge request url:
https://git.drupalcode.org/project/oauth2_client/-/merge_requests/8.patch
Comment #17
fathershawn