prevent user to access specific pages after login with Azure AD
up vote
0
down vote
favorite
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.
c# asp.net
add a comment |
up vote
0
down vote
favorite
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.
c# asp.net
You could add a flag on the user's session that they are not an approved account. Or you could add a claim on their identity stored in the cookie that says the same thing. Then you can base authorization on that.
– juunas
Nov 22 at 7:08
Thank you @juunas for your reply. But how can base authorization on claims since my application is not MVC?
– kst92
Nov 22 at 17:43
Classic ASP.NET?
– juunas
Nov 22 at 17:49
yes @juunas. Do you have an idea of how to do it ? please
– kst92
Nov 22 at 18:56
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
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.
c# asp.net
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.
c# asp.net
c# asp.net
asked Nov 21 at 19:55
kst92
34
34
You could add a flag on the user's session that they are not an approved account. Or you could add a claim on their identity stored in the cookie that says the same thing. Then you can base authorization on that.
– juunas
Nov 22 at 7:08
Thank you @juunas for your reply. But how can base authorization on claims since my application is not MVC?
– kst92
Nov 22 at 17:43
Classic ASP.NET?
– juunas
Nov 22 at 17:49
yes @juunas. Do you have an idea of how to do it ? please
– kst92
Nov 22 at 18:56
add a comment |
You could add a flag on the user's session that they are not an approved account. Or you could add a claim on their identity stored in the cookie that says the same thing. Then you can base authorization on that.
– juunas
Nov 22 at 7:08
Thank you @juunas for your reply. But how can base authorization on claims since my application is not MVC?
– kst92
Nov 22 at 17:43
Classic ASP.NET?
– juunas
Nov 22 at 17:49
yes @juunas. Do you have an idea of how to do it ? please
– kst92
Nov 22 at 18:56
You could add a flag on the user's session that they are not an approved account. Or you could add a claim on their identity stored in the cookie that says the same thing. Then you can base authorization on that.
– juunas
Nov 22 at 7:08
You could add a flag on the user's session that they are not an approved account. Or you could add a claim on their identity stored in the cookie that says the same thing. Then you can base authorization on that.
– juunas
Nov 22 at 7:08
Thank you @juunas for your reply. But how can base authorization on claims since my application is not MVC?
– kst92
Nov 22 at 17:43
Thank you @juunas for your reply. But how can base authorization on claims since my application is not MVC?
– kst92
Nov 22 at 17:43
Classic ASP.NET?
– juunas
Nov 22 at 17:49
Classic ASP.NET?
– juunas
Nov 22 at 17:49
yes @juunas. Do you have an idea of how to do it ? please
– kst92
Nov 22 at 18:56
yes @juunas. Do you have an idea of how to do it ? please
– kst92
Nov 22 at 18:56
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53419614%2fprevent-user-to-access-specific-pages-after-login-with-azure-ad%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You could add a flag on the user's session that they are not an approved account. Or you could add a claim on their identity stored in the cookie that says the same thing. Then you can base authorization on that.
– juunas
Nov 22 at 7:08
Thank you @juunas for your reply. But how can base authorization on claims since my application is not MVC?
– kst92
Nov 22 at 17:43
Classic ASP.NET?
– juunas
Nov 22 at 17:49
yes @juunas. Do you have an idea of how to do it ? please
– kst92
Nov 22 at 18:56