Skip to content

HC 12.16 #/oauth includes fragment which is not an allowable redirect uri for Azure AD B2C #5661

@eginwong

Description

@eginwong

Is 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

  1. Boot up a C# project running 12.16 of HotChocolate.
  2. Navigate to the graphql endpoint and try to authenticate by clicking the gear icon.
  3. Under authentication, select OAuth2 -> Implicit.
  4. 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.*

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions