I am having issues with ADAL login, so I grabbed the latest version of react-aad-implicitflow and tested it out. I modified the client id be the same I was using, deployed and tested a few environments.

Expected Behavior

I am expecting the sample to work on a modern & classic page the same as on the workbenches. So running on the local workbench and https://.../_layouts/15/workbench.aspx, I can signin and see the upcoming meetings.

Observed Behavior

However, when I switch to a modern page, I get a 400 - Bad Request Error, Invalid URL. Here is the request that give the error: https://.../sites/dev-portal/SitePages/access_token={token}&token_type=Bearer&expires_in=3599&state={guid}%7chttps%3a%2f%2fgraph.microsoft.com&session_state={guid}

I added a few variants in the redirect url:

I also tried changing the Home Page URL to those. Same issue.


What am I doing wrong, anyone able to have this working?

1 Answer 1


/SitePages/access_token= is not a valid URL which explains the error that you are getting. The return URL of your application should be set to the absolute URL of the page where the web part is located, eg: https://contos.sharepoint.com/sites/dev-portal/SitePages/mypage.aspx

  • Thanks @Waldek, that helped. I already had the URL in the Reply Urls. To properly test, I needed an Incognito window each time and found that when I navigate to https://contoso.sharepoint.com/sites/dev-portal/SitePages/mypage.aspx/ (notice the ending slash), it works properly. Is this a bug? May 15, 2017 at 18:47
  • It seems like one. Is the / at the end of the URL result of a server-side or a client-side redirect? What do you see in the developer tools/fiddler? May 16, 2017 at 6:28
  • It is not part of a redirect, based of the error I was receiving, I decided to manually add the slash to see if that would work, and it did! However, I had to start a new private session, if I had clicked the signin button on the URL without the slash, adding the slash would give the same error as in my original question. I am not quite sure what you are looking for in the dev tools. May 17, 2017 at 9:47
  • Should I open an issue on Github? May 17, 2017 at 12:47
  • For this particular sample it would be the best to open an issue on GitHub indeed. As for the dev tools, I'm interested in the redirects that take place in browser after starting authentication. May 18, 2017 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.