Skip to content
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

Is there a B2C sample with access token requests available ? #511

Closed
1 of 17 tasks
Lu-Fi opened this issue Jul 7, 2021 · 3 comments
Closed
1 of 17 tasks

Is there a B2C sample with access token requests available ? #511

Lu-Fi opened this issue Jul 7, 2021 · 3 comments
Labels
Answered question Further information is requested

Comments

@Lu-Fi
Copy link

Lu-Fi commented Jul 7, 2021

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

The issue was found for the following scenario:

Please add an 'x' for the scenario(s) where you found an issue

  1. Web app that signs in users
    1. with a work and school account in your organization: 1-WebApp-OIDC/1-1-MyOrg
    2. with any work and school account: /1-WebApp-OIDC/1-2-AnyOrg
    3. with any work or school account or Microsoft personal account: 1-WebApp-OIDC/1-3-AnyOrgOrPersonal
    4. with users in National or sovereign clouds 1-WebApp-OIDC/1-4-Sovereign
    5. with B2C users 1-WebApp-OIDC/1-5-B2C
  2. Web app that calls Microsoft Graph
    1. Calling graph with the Microsoft Graph SDK: 2-WebApp-graph-user/2-1-Call-MSGraph
    2. With specific token caches: 2-WebApp-graph-user/2-2-TokenCache
    3. Calling Microsoft Graph in national clouds: 2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph
  3. Web app calling several APIs 3-WebApp-multi-APIs
  4. Web app calling your own Web API
    1. with a work and school account in your organization: 4-WebApp-your-API/4-1-MyOrg
    2. with B2C users: 4-WebApp-your-API/4-2-B2C
    3. with any work and school account: 4-WebApp-your-API/4-3-AnyOrg
  5. Web app restricting users
    1. by Roles: 5-WebApp-AuthZ/5-1-Roles
    2. by Groups: 5-WebApp-AuthZ/5-2-Groups
  6. Deployment to Azure
  7. Other (please describe)

Versions

ASP.NET Core 3.1

Attempting to troubleshooting yourself:

I Tried the "1-WebApp-OIDC/1-5-B2C/" sample with https://docs.microsoft.com/de-de/azure/active-directory/develop/scenario-desktop-acquire-token?tabs=dotnet but since "GetAccountsAsync" is removed (AzureAD/microsoft-authentication-library-for-dotnet#1967), this won't work.

@jmprieur jmprieur added Answered question Further information is requested labels Jul 7, 2021
@jmprieur
Copy link
Contributor

jmprieur commented Jul 7, 2021

@Lu-Fi.
I don't understand what you are trying to do.

this sample works

I just tried this sample again (we do test them each time we release Microsoft.Identity.Web anyway, so I was surprised if it didn't work).

cd  1-WebApp-OIDC\1-5-B2C
dotnet run

and navigated to https://localhost:44316 in a browser and I was able to sign-in as expected.

Are you looking for a sample for a web API?

Would you be trying to call a web API? If that's the case, that's the sample you need:
https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/4-WebApp-your-API/4-2-B2C

otherwise, do you have repro steps

To help you better, please provide repro steps with expected and actual results.

Some comment

If you write you were trying to apply the desktop interactive logging to a web app, this won't work. GetAccountsAsync() is only removed from confidential client applications (web apps, web APIs, daemon apps) as it does not make sense there, but it's working for desktop applications

@Lu-Fi
Copy link
Author

Lu-Fi commented Jul 7, 2021

Sry for this misunderstanding.

I was searching for a solution where additional access tokens can be requestet after initial authentication.

@jmprieur
Copy link
Contributor

jmprieur commented Jul 7, 2021

I think the sample I provided will work, @Lu-Fi

@Lu-Fi Lu-Fi closed this as completed Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Answered question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants