Last post Nov 23, 2018 03:20 AM by Nan Yu
Nov 21, 2018 08:02 PM|kstMan|LINK
Hello, I'm working on a .Net application in which user can authenticate with a form using an Id or a Microsoft account (Azure Active Directory). The problem is that a user who doesn't yet have an account on my application can still connect via AD. After
authentication, I would like to redirect him to a registration page for his account to be approved first. Since he is already authenticated, is there a way to prevent access to other pages?
I need some help, Thank you.
Nov 22, 2018 02:56 AM|Nan Yu|LINK
Hi KstMan ,
You could add a custom property in database which shows whether user is confirmed . Before login , you could add user claim :
So that you can get the value of claim easily in your controller/view . After user confirmed , modify the database and change the property .
Nov 22, 2018 09:14 PM|kstMan|LINK
Thank you Nan Yu for your reply. But, is it possible to use claims based authorization even if my application is not MVC?
Nov 23, 2018 03:20 AM|Nan Yu|LINK
No matter in MVC or webForms using OpenID Connect and OAuth2 middleware with Azure AD , You can add custom claim to SecurityTokenValidated function :
Then you could retire value anywhere after authentication .