HC 12.16 #/oauth includes fragment which is not an allowable redirect uri for Azure AD B2C
See original GitHub issueIs there an existing issue for this?
- I have searched the existing issues
Describe the bug
The effect: the access token is not able to be fetched from BCP because the redirect uri is not in the allowable list of uris as configured by Azure AD B2C.
We are using Azure AD B2C and it does not allow having the # symbol in the allowed redirect uris, specifically when the signinaudience is AzureADandPersonalMicrosoftAccount
for the oauth2 implicit flow.
And if we can’t put the #/oauth uri in the allowed redirect uri list, Azure AD will not allow BCP to receive the token.
Image of the Azure AD B2C error
Affects HC 12.16, but not 12.15.* due to new major version of BCP.
Steps to reproduce
- Boot up a C# project running 12.16 of HotChocolate.
- Navigate to the graphql endpoint and try to authenticate by clicking the gear icon.
- Under authentication, select OAuth2 -> Implicit.
- Note that the Redirect URL is hardcoded and not allowed to be changed.
Using Azure AD B2C App Registration, the redirect uri cannot contain a fragment uri if the signinaudience value is AzureADandPersonalMicrosoftAccount. If it is AzureADMyOrg, then the fragment uri is acceptable.
Allowed settings for signinaudience: AzureADMultipleOrgs, AzureADMyOrg, AzureADandPersonalMicrosoftAccount, PersonalMicrosoftAccount
Relevant log output
No response
Additional Context?
As per discussion in #announcements on Jan 6, 2023.
Product
Hot Chocolate
Version
12.16.*
Issue Analytics
- State:
- Created 8 months ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
Is there any update on this issue? I assume not everything went well and the release is delayed but not being able to work with BCP when using Azure AD is a shame, the OAuth integration was great and sets BCP apart from other Playgrounds.
@onionhammer See this
surpises me. This must be a special case for the local host origin. After using window.open , the reference to window.href should no longer be accessible.
The redirect URL is not specified in the desktop app because there we have more options. In other words, you can pick any redirect URL and it will work.
We are currently testing a fix for the web version. If everything goes well, it will be available in the next BCP version next week.