Application User Roles with Azure B2C

  Рет қаралды 7,691

The Pragmatic Programmer

The Pragmatic Programmer

Күн бұрын

Пікірлер: 16
@danieloskar
@danieloskar 2 жыл бұрын
I am very dissapointed that we need work arrounds like this in the first place for Azure AD B2C. This should be functionality that is provided out of the box. Thanks for you video anyway!
@thepragmaticprogrammer
@thepragmaticprogrammer 2 жыл бұрын
Thanks for the feedback. I agree its more work, but it does give a clean separation of concerns between authentication and authorisation. Something out of the box as well would be nice though.
@Marcel-dt5du
@Marcel-dt5du Жыл бұрын
I agree whole heartedly.. I mean the functionality is there in AAD, why is it different with AAD B2C?
@galsoftware
@galsoftware 11 ай бұрын
Usually you would have a very custom logic regarding what claims do you want to include. Imagine that you want to simulate a multi tenant environment. How would you do that without such custom code?
@ogunacg3387
@ogunacg3387 Ай бұрын
As far as I know, there is a possibility to include a user who has been authenticated by entra id by adding the entra id provider to Azure B2c, but I am not sure the roles that entra id gave to the user comes with that user. So, do you know it is feasible?
@عروضوهميزات-ل5غ
@عروضوهميزات-ل5غ Жыл бұрын
Hello, thank you for this awesome tutorial,Why not use azure b2c groups to do that ? is it possible ?
@ben.y.g
@ben.y.g 10 ай бұрын
Instead of setting up a reverse proxy, you can use something like ngrok to expose a local endpoint.
@midowazzan
@midowazzan 7 ай бұрын
One of the best videos on custom claims. However, this does not work when the user is self-registering. This is because the first time the user registers, their data is not yet in the DB and so the Azure Function won't return any roles yet. To overcome the problem the user will have to log out and back in to refresh the claims which is not ideal. I could not find any solutions for this problem.
@thepragmaticprogrammer
@thepragmaticprogrammer 7 ай бұрын
I'm not 100% understanding you scenario. First problem - What permissions will you give a new user? You can only give them some defaults unless in your signup you allow them to tell you what role/permissions they want. if you look here learn.microsoft.com/en-us/azure/active-directory-b2c/add-api-connector?pivots=b2c-user-flow You can see there are different types of API connector that get called at different points in the sign-up/in flow. So for signup could you use the 'before creating the user' connector to create the user. For signup and / or signin the 'before sending the token' will be called. So could you not use this connector to create the user with the default permissions if they dont exist in your db?
@midowazzan
@midowazzan 7 ай бұрын
@@thepragmaticprogrammer Thanks for your reply, really appreciate it. I had a feeling I was not being clear. Here is my issue in details: 1. User visits the app and opens the login page (they're not the in the DB yet and so they have roles). 2. User is redirected to B2C page to log in/sign up. 3. User completes sign up in B2C. 4. Behind the scene: B2C calls Azure Function to grab the roles (they don't exist yet) 5. Behind the scene: B2C generates a token, it does not have any roles. 6. User is redirected back to my app (with the token) to fill out their profile information. 7. User is redirected to the Dashboard page. This page requires a role that is not present in the token. 8. User sees a NotAllowed page. The only way around this is to log the user out and ask them to log back in. When they do this the Azure Function will be able to load the roles. I'm going to see if I can resolve this by using your suggestions. Thanks
@midowazzan
@midowazzan 7 ай бұрын
Found out that the suggestions above won't fix my issue. :(
@mohamedyounesse
@mohamedyounesse 2 жыл бұрын
there is method to protect any fuction by identity microsot account and make specific role for specific users plz do you have tutorial for that
@GameSpreePH
@GameSpreePH 7 ай бұрын
Nice tutorial. Do you have github repo for this Azure function?
@behrouzseyedi
@behrouzseyedi Жыл бұрын
Thanks, It was helpful. Keep it up. 👍
@n8allan
@n8allan Жыл бұрын
Is there a reason scopes can't just be treated like user roles? Great tutorial, thank you.
@thepragmaticprogrammer
@thepragmaticprogrammer Жыл бұрын
Scopes are attached to the ‘application’ that is registered in B2C. So scopes will not change on a per user basis.
.Net Core Web API Azure AD Authentication and Authorization
28:20
AzureTeach•Net
Рет қаралды 76 М.
Don't use HTTP Authorization Header with Azure Static Webapps!
0:52
The Pragmatic Programmer
Рет қаралды 622
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 15 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 39 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 59 МЛН
Azure AD B2C -  Azure AD as Identity Provider
24:01
Stack Simplify
Рет қаралды 16 М.
Working with Azure AD B2C in ASP.NET
27:11
dotnet
Рет қаралды 18 М.
Azure B2C Identity Experience Framework (IEF)
30:40
Atmosera
Рет қаралды 10 М.
Lesson 030 2024 11 30 mfe react js 1
1:05:13
Web Development
Рет қаралды 22
Using Azure B2C with An App
22:56
Atmosera
Рет қаралды 39 М.
How to Setup Authentication for Azure Functions
20:44
Azure App Modernization
Рет қаралды 34 М.