-
Notifications
You must be signed in to change notification settings - Fork 33
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
Enable AuthorizationCodeCredential
for PublicClientApplication
#493
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are you expecting to use the AuthorizationCodeCredential
in a spa application? You wouldn't make a normal post token request to get an access token. The access token would come on the redirect from login.
Are you saying this is an issue with refreshing tokens?
That warning is not saying don't use a client secret. Its saying dont use this flow in a spa application becuase of the client secret.
@Jeadie I think I see what the issue is. You want to use a spa based public client via authorization code credential. Your access token and refresh token both come on the redirect. But your AuthorizationCodeCredential doesn't use a client secret in this type of flow. This would be the implicit flow but this has also been changed to be the Auth code flow with PKCE. Is this correct? Can you please provide an description of what it is you are expecting to happen and the walk through of the flow your using exactly? I think what your looking for is detailed here right? https://learn.microsoft.com/en-us/entra/identity-platform/reference-third-party-cookies-spas#overview-of-the-solution |
We're attempting to have users (running a tool locally), retrieve a |
Gotcha. Thanks for the response. I beleive #495 should solve this issue still. In that PR I made the PKCE required because thats what the auth flow says is required. But if its allowing you to do so without it I can make it optional. Let me know. |
Closing this out as the other work I mentioned got merged and I havn't heard anything back here. Let me know if there is an issue going forward. |
graph-rs-sdk
for authentication aPublicClientApplication
withAuthorizationCodeCredential
, I ran into several issues.impl TokenCredentialExecutor for AuthorizationCodeCredential
'sfn form_urlencode
. We no longer check for a missing or emptyclient_secret
, as per docs,'required for confidential web apps... Don't use the application secret in a native app or single page app because a client_secret can't be reliably stored on devices or web pages.'
(see https://learn.microsoft.com/en-us/entra/identity-platform/v2-oauth2-auth-code-flow#request-an-access-token-with-a-client_secret).