-
Notifications
You must be signed in to change notification settings - Fork 234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error. We're having trouble signing you in. Please sign in again. Unauthorized #20
Comments
Not sure what message you are seeing. Could you repaste it? Yes, you will need to make changes to your TaskService Web Config. You need to update it with your B2C configuration (e.g. the client ID of the Web API app registration, your tenant name) |
@parakhj The Error-message I get is in the title :) Or did you mean something else? |
There are multiple pages linking to this repo, depending on what you are trying to achieve. Check out the readme of this repo |
@MrCharli3 Hello! 👋 I just made some updates to the readme earlier today that show step-by-step how to register both apps (the web app and the web api) in the Azure portal and how to configure both VS projects (i.e. the sample apps available in the solution in this repo) to use your tenant. Please take a look and let us know if you still have any questions! Thanks! |
Please note, I saw this when I forgot the trailing /, for the api:ApiIdentifier. .. key="api:ApiIdentifier" value="https://forexample.onmicrosoft.com/myapi" Must be Since the scopes are created by appending the security token, I was getting myapiread, as opposed to myapi/read in the code example. |
@dblaszyk Thanks for calling this out! I've added a quick 📝 in the readme to verify that the trailing |
I followed all the instructions but when i try to access the to-do-list it gives this error
Am i missing something in the configuration?? |
Please, re-open if this is happening in the latest version of this sample |
Hello, It seems I am also having the same issue with the lastest documentation. After some investigation, it seems that var accounts = await cca.GetAccountAsync(); returns 0 account the first time, it's called. After that, it goes to: Then, it goes again in the Index method and this time there is one account and the UserName is " It seems that in the TaskController.cs, when I am trying to get the token (even if I am already signin), I get a null AccessToken. |
I have followed the same documentation. https://docs.microsoft.com/en-ca/azure/active-directory-b2c/tutorial-web-api-dotnet?tabs=app-reg-ga I'm successfully login into WebApp. But getting the issue while accessing the API. Also, I have granted both web app and well as API from Azure AD B2C. Any help would be highly appreciated. |
I had same issue - I went to the WebApp app registration and needed to grant admin consent - before I did the status said something else and was not green. otherwise put a breakpoint in TasksController.Index() when it calls cca.AcquireTokenSilent - does result.AccessToken have a value? it was null for me until I made the change below. hope this helps. |
When I try to Access the To-do list I get the following message.
It finds my claim just fine, and it says I'm signed in.
Web.config:
Do I need to make any changes to TaskService Web Config?
The text was updated successfully, but these errors were encountered: