syncweek-react-aad / react-aad

A React wrapper for Azure AD using the Microsoft Authentication Library (MSAL). The easiest way to integrate AzureAD with your React for authentication.
MIT License
344 stars 94 forks source link

Document The Samples Better #274

Open opticyclic opened 4 years ago

opticyclic commented 4 years ago

Library versions

Describe the bug Following on from #207 the Javascript sample appears to be redirecting to the wrong URL

After testing the MS sample https://github.com/Azure-Samples/active-directory-b2c-javascript-msal-singlepageapp

I modified your sample to have the same config:

auth: {
  authority: "https://mine.b2clogin.com/mine.onmicrosoft.com/B2C_1_signupsignin1",
  clientId: "111xxx11-x111-111x-x11x-111xx11x1x11",
  postLogoutRedirectUri: window.location.origin,
  redirectUri: window.location.origin,
  validateAuthority: true,

The sample tries to get https://login.microsoftonline.com/common//discovery/instance?api-version=1.1&authorization_endpoint=https://mine.b2clogin.com/mine.onmicrosoft.com/b2c_1_signupsignin1/oauth2/v2.0/authorize and logs an error 400.

Expected behavior If I change validateAuthority: true, to validateAuthority: false, it then gets https://mine.b2clogin.com/mine.onmicrosoft.com/b2c_1_signupsignin1/v2.0/.well-known/openid-configuration and works.

Can you document what this means and add a README to the samples since this is clearly tripping up multiple people.