Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

b2clogin.com for ASP.NET Core #80

Closed
RadOsinski opened this issue Aug 30, 2019 · 7 comments
Closed

b2clogin.com for ASP.NET Core #80

RadOsinski opened this issue Aug 30, 2019 · 7 comments

Comments

@RadOsinski
Copy link

Hello,

I would like to ask for code update for using ASP.NET Core 2.2 MVC with b2clogin.com
According to docummentation onmicrosoft.com is not recommended:
https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/active-directory-b2c/b2clogin.md

Additionally onmicrosoft.com cannot be used to to enable JavaScript on custom pages:
https://docs.microsoft.com/en-us/azure/active-directory-b2c/javascript-samples

@jmprieur
Copy link
Contributor

@RadOsinski : can you please try this sample: https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-5-B2C.
It's part of an incremental tutorial and is about a Web App that signs-in users with B2C and uses b2cLogin

cc: @negoe @henrik-me @bgavrilMS @jennyf19

@RadOsinski
Copy link
Author

@jmprieur Thanks! That resolve an issue!

@akourbat
Copy link

akourbat commented Oct 21, 2019

I also ran into this problem and it took me a few days looking for answers. I suggest you change the AzureAdB2COptions class in the sample so that it uses b2clogin.com by default, otherwise access tokens are rejected by protected APIs - since most of them use b2clogin.com authority, and not soon-to-be deprecated https://login.microsoftonline.com/tfp, which is hard-coded into the sample.

@TiagoBrenck
Copy link
Contributor

@akourbat
Copy link

The above example only handles log-in to a webapp, and not a scenario where webapp then accesses a back-end webapi on behalf of the user like this repo does.

@TiagoBrenck
Copy link
Contributor

Oh I see. The version that you re looking for is under review: Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2#192

@jmprieur
Copy link
Contributor

Closing this issue as this sample is being archived and replaced by a newer ASP.NET Core 3.1 sample.
See Readme.md

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants