-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BC Idea]: OAuth2 Authorization with Audience Paramater #2966
Comments
@JesperSchulz I see an internal work item was added. Am I good to proceed on this then? |
@mjmatthiesen, sorry, I was out for a while and am trying to catch up on everything here on GitHub 😊 |
@JesperSchulz Not to worry. I just didn't want to spend time on it if it didn't have a chance of merging, because my solution was only theoretical. Turns out the theory was not entirely sound. After doing some initial work, I realize that I misunderstood what the OAuth2 module is actually capable of. I had made the assumption that it is able to handle oauth for any standard compliant interface. As in the user has a login, authorizes our app on that service, and then gets a refresh and access token that BC stores and we can request for an API call. Adding the audience I can do the login process, but I cannot get the tokens. I understand now that it's out of scope of this codeunit. I do believe I can leverage the login and callback process to get my auth code and then handle retrieval of tokens myself, but that will require some additional testing from me. Even just that part would greatly simplify it for us. I did some research and see now that it is structured to always go to
or without the trailing slash it becomes
I guess really the question is if it is out of scope to do something more generic, i.e. use the returned auth code to get the access and refresh token, but maybe that is something MS is already planning for. |
Let's get some of our security experts on this case. I've pinged them in the linked PR. |
BC Idea Link
https://experience.dynamics.com/ideas/idea/?ideaid=4f0a39a0-eeea-ef11-a4de-7c1e52b9f07c
Description
The idea is simple, add an overload to the current OAuth2 codeunit (and the implementation) that allows adding the audience param to the url. Functionally this is similar but not the same as resource url or a scope.
I could implement OAuth2 myself, but the issue I run into is that I need different callback urls for each environment and I would love to avoid that headache.
If I am good to proceed on this, I can create a PR and implement a method similar to
AppendPromptParameter
as I am not able to changeOAuthAuthorization.CalculateAuthRequestUrl
. The latter may have an overload available, but I was not able to inspect it.I will provide the implementation for this BC Idea
Internal work item: AB#565907
The text was updated successfully, but these errors were encountered: