-
Notifications
You must be signed in to change notification settings - Fork 345
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
Redirect URI should not be required for Confidential Client #426
Comments
You should be able to pass null and not run into issues. |
@kpanwar can that be documented? Right now the param comments say that it's required, so people may get confused |
Sure! I will kee this issue open to track the work. |
Actually passing redirect uri as null causes an exception when calling
I think it comes down to this, which won't work unless microsoft-authentication-library-for-dotnet/src/Microsoft.Identity.Client/ClientApplicationBase.cs Line 234 in d5026d5
Code itself: var scopes = new[] {"https://graph.microsoft.com/user.read"};
var userTokenCache = new TokenCache();
var cca = new ConfidentialClientApplication(clientSettings.ClientId, null, new ClientCredential(clientSettings.AppKey), userTokenCache, null);
await cca.AcquireTokenOnBehalfOfAsync(scopes, GetUserAssertion(userInformation)) |
We need a redirect URL for the authorization code grant, but not for client creds, OBO, ... |
@bgavrilMS : this one is poachable |
@jmprieur - I propose that we make sure the docs emphasize where redirect URI can be null and fix the exception for OBO flow and client creds. Alternatively, I can obsolete the calls requiring a redirectUri so that we can remove them in when we get rid of the -preview tag? |
@bgavrilMS : I'd prefer the first option (allow null, fix the exception for Client credentials. Not sure for OBO?) |
Hi, |
@MSAppsDev - no, the issue is still open. |
@MarkZuber : done part of the confidential client builder based app configuration |
In 3.x, constructing with null will set the default redirecturi to be urn:ietf:wg:oauth:2.0:oob and that redirecturi will get used during any requests as needed. I've added unit tests to explicitly cover this case in dev3x. |
@MarkZuber just for confidential clients? |
yes, just for Client Credentials, actually (daemon apps) |
Fixed in MSAL 3.0.0-preview release |
Some flows, like the On-behalf-of flow don't require a redirect URI, so that value shouldn't be required in the ConfidentialClient constructor.
The text was updated successfully, but these errors were encountered: