opened
aszalacinski
username_0
Following this tutorial and have gone through it multiple times to make sure everything is set right.

Upon login with a user (one who is registered with my tenant), the login popup goes away but then comes back with no changes to the parent page. I have't touched the code from github and I am seeing no errors in the console.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 370e4c33-91b6-eafb-1ced-0a079449d982
* Version Independent ID: cefd38c9-5c1e-c381-0549-ded07f752f97
* Content: [Tutorial - Enable authentication in a single-page application  - Azure Active Directory B2C](https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-tutorials-spa)
* Content Source: [articles/active-directory-b2c/active-directory-b2c-tutorials-spa.md](https://github.com/Microsoft/azure-docs/blob/master/articles/active-directory-b2c/active-directory-b2c-tutorials-spa.md)
* Service: **active-directory**
* Sub-service: **b2c**
* GitHub Login: @username_3
* Microsoft Alias: **davidmu**
Does not login
issue
created
aszalacinski
username_0
Digging into the code, this tutorial assumes one has setup the API and needed scopes. If you follow this tutorial straight through, top to bottom, it gives the above behavior.
comment
created
Mike-Ubezzi-MSFT
username_1
@username_0 Thank you for the detailed feedback. We are actively investigating and will have the content owner make an update as appropriate.
comment
created
MarileeTurscak-MSFT
username_2
Hi @username_0 ,

Thanks for your valuable feedback! Is this related to the other issue you created where you said that you managed to get it to work by using an older version of MSAL, or are you still stuck on the login issue?
comment
created
aszalacinski
username_0
It is not. It's based on how the Tutorial section is setup. If you follow the tutorial from "top to bottom" the code sample references an API that you don't setup until the next tutorial, protecting an API. If you leave the code as is, you get the experience I mentioned in the original comment. 

I have found solutions to my code obstacles by digging into the msal library and accompanying sample code however this tutorial page in the docs may cause some confusion. Thanks for getting back to me!
comment
created
MarileeTurscak-MSFT
username_2
Thank you, @username_0 

I am assigning this to the content author, @username_3 .

Which is the API setup tutorial that you are referring to? Do you think it would be enough to include a note in the document that this is a prerequisite?
comment
created
davidmu1
username_3
@username_2: Please assign this item to @username_6 who is now supporting Azure AD B2C.
comment
created
davidmu1
username_3
@username_2: Please assign this item to @username_6 who is now supporting Azure AD B2C.
comment
closed
ShannonLeavitt
username_4
issue
created
KepanoEgg
username_5
Not sure why this is marked as closed, still having the same issue. I followed this "from top-to-bottom" and I'm still having an issue with the "ServerError: AADB2C90205: This application does not have sufficient permissions against this web resource to perform the operation." 
Seems like I'm having the same issue where this code is asking for an access token to something I haven't built yet
comment
created
mmacy
username_6
@username_5 It seems you might have missed the [Error: insufficient permissions](https://docs.microsoft.com/azure/active-directory-b2c/active-directory-b2c-tutorials-spa#error-insufficient-permissions) section of the article, which states:
___
### Error: insufficient permissions

After you sign in, the app displays an insufficient permissions error - this is **expected**:

`ServerError: AADB2C90205: This application does not have sufficient permissions against this web resource to perform the operation.`

You receive this error because you're attempting to access a resource from the demo directory, but your access token is valid only for your Azure AD directory. The API call is therefore unauthorized.

Continue with the next tutorial in the series (see [Next steps](#next-steps)) to create a protected web API for your directory.
___

Admittedly not the best experience for a tutorial, however. I'll start a discussion internally about updating the sample and tutorials to improve the flow so that errors like this aren't thrown at the end of the tutorial.
comment
created
KepanoEgg
username_5
You are correct, I did miss that section, but I also agree that it's not ideal for a tutorial.
comment
created
KepanoEgg
username_5
@username_6 So the next step has me set up an API on my B2C tenant as well, so the token still won't work, because it's not on my AD tenant.  Did I miss a step there?
comment