fix: pass OAuth 2.0 scope parameter in AAD token retrieval - #175
Draft
Martin Roschitz (mrMRosch) wants to merge 1 commit into
Draft
Martin Roschitz (mrMRosch) wants to merge 1 commit into
Martin Roschitz (mrMRosch) wants to merge 1 commit into
Conversation
OAuth v2-0 requires scope to be set. was missing in the method call to take effect.
Martin Roschitz (mrMRosch)
marked this pull request as draft
September 16, 2026 14:35
Author
|
while exploring the SDK further, the implementation of passing scope from all classes using this method would require significant rework. it works but will not add a plus to the sdk. However here are my findings in what places need also an implementation of the scope parameter, which i haven't the knowledge of (right now): ZCL_ADF_SERVICE_REPROCESShas method to get aad token which in turn calls CALL METHOD lo_ref_aad->get_aad_token
EXPORTING
iv_client_id = iv_client_id
iv_resource = CONV #( iv_resource )
IMPORTING
ev_aad_token = DATA(lv_aad_token)
ev_response = DATA(lv_response).further implementation would need changes to
ZCL_O365_SERVICE_SHAREPOINTcalling the get_aad_token method with global variables * gv_client_id ----> ClientID@TenantID
* gv_resource ----> resource/SiteDomain@TenantID
CALL METHOD lo_ref_aad->get_aad_token
EXPORTING
iv_client_id = gv_client_id
iv_resource = gv_resource
IMPORTING
ev_aad_token = ev_aad_token
ev_response = ev_response.which would need further changes in:
|
Collaborator
|
Nice Martin! Please let us know when ready for review |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: pass OAuth 2.0 scope parameter in AAD token retrieval
Problem
The Azure ABAP SDK's AAD token retrieval was failing against Microsoft Entra ID with error:
Root Cause
method
ZCL_ADF_SERVICE_AAD->get_aad_token()accepts aniv_scopeparameter but does not pass it to the internalget_aad_token_clnt_cred()call.get_aad_token_clnt_cred()has already full support for scope parameter.Changes:
before:
after
Tested with SharePoint Online via Entra ID. Token retrieval now succeeds.