question

EyobZeleke-8764 avatar image
0 Votes"
EyobZeleke-8764 asked RakeshJagatap-4451 commented

Web Application hosted in Azure DevOps .

I have a web application (.net framework) hosted in Azure DevOps. Trying to add code to authorize some pages based on what Azure Roles the user belongs to. In the non-cloud Activie Directory, I used to use MicrosoftIdentity to do this task. Any leads would be awesome. Thanks.

azure-active-directorydotnet-aspnet-webforms
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi, if the posted answer resolves your question, please mark it as the answer by clicking the check mark. Doing so helps others find answers to their questions.

0 Votes 0 ·

1 Answer

CristianSPIRIDON72 avatar image
0 Votes"
CristianSPIRIDON72 answered CristianSPIRIDON72 commented

Hi,

You can start from here.
In addition, you can use groups for authorization. There are some code samples links in above documentation.

Hope this helps.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you. That's helpful.

1 Vote 1 ·

@CristianSPIRIDON72 I Created the app roles in azure and assigned users. Now, the Application I want to consume these roles in is a web application (webforms) hosted in azure. How do i use the roles in webforms? The specific scenario is I have a couple of aspx pages that I want only limited users have access to. So based on the roles, I would like to limit access to these pages. Most of the examples are either for a web api or mvc application. I would appreciate any help on this. Code samples would be great. Thanks.

0 Votes 0 ·

There is a sample app on github that uses two App Roles:

https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/5-WebApp-AuthZ/5-1-Roles

You will find in the README how you can enforce that signin user have particular role to be able to access a particular action from a controller.

Please be aware that the sample uses dotnet core.

Hope this helps.

0 Votes 0 ·