Replies: 1 comment
-
An improved variant of this suggestion is implemented in #21591 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
While looking through the new SharePoint module I stumbled upon this piece of code:
ALAppExtensions/Modules/System/SharePoint Authorization/src/AuthorizationCode/SharePointAuthorizationCode.Codeunit.al
Lines 70 to 76 in 1fee695
If I am not mistaken,
AcquireTokenByAuthorizationCode()
will pop upp a new window for authentication. And even if that window auto-closes if the credentials are cached in the web client (thanks to theNone
parameter), this will not work if being performed in a background session like from the Job Queue or in a web service session, even if the user has cached tokens.I think a better approach would be something like below (I don't like the IsSuccess variable approach, but that's just a matter of taste) :
We are using above approach successfully when getting access tokens in the background. As long as the user runs this in the UI now and then (I think every 3rd month), the background session can fetch an access token through the cache.
Calling AcquireTokenByAuthorizationCode from the a background session causes this error:
Microsoft Dynamics 365 Business Central Server attempted to issue a client callback to run page 502 OAuth2ControlAddIn as modal. Client callbacks are not supported on Microsoft Dynamics 365 Business Central Server.
What do you think @IhorHandziuk?
Beta Was this translation helpful? Give feedback.
All reactions