active-directory-dotnet-webapp-roleclaims | NET 4.5 MVC web app that uses Azure AD | Identity Management library
kandi X-RAY | active-directory-dotnet-webapp-roleclaims Summary
kandi X-RAY | active-directory-dotnet-webapp-roleclaims Summary
A .NET 4.5 MVC web app that uses Azure AD application roles for authorization.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of active-directory-dotnet-webapp-roleclaims
active-directory-dotnet-webapp-roleclaims Key Features
active-directory-dotnet-webapp-roleclaims Examples and Code Snippets
Community Discussions
Trending Discussions on active-directory-dotnet-webapp-roleclaims
QUESTION
We would like our customers to be able to authenticate using either personal or work accounts. We have set up a seperate AD in Azure to which customers are invited which should grant them access to our application.
In the ASP.NET Core application https://login.microsoftonline.com/{myTenantID}/v2.0
is used as authentication endpoint. A client id and secret from an application registered in the preview app registration through the portal is provided with the request. Authenticating our work accounts works smoothly, but when attempting to authenticate most personal accounts an error message is returned: An error was encountered while handling the remote login. AADSTS50020: MSA guest token redemption attempt on v2 common endpoint.
Should it not be possible to authenticate a MSA using a tenant-specific endpoint (only /common
)?
Similar problem: Azure AD B2B Authentication error for users with custom domains - AADSTS65005: Using application 'My Application' is currently not supported
Also, this comment points out that authenticating MSAs in multi-tenant apps will not work, however, ours should be sigle-tenant: https://github.com/Azure-Samples/active-directory-dotnet-webapp-roleclaims/issues/10#issuecomment-145125080
...ANSWER
Answered 2019-Feb-18 at 14:54You need to use common endpoint if you are targeting both B2C and B2B using v2 endpoint for both work and personal emails to be able to call Azure AD protected endpoints.
QUESTION
I've succesffully created a web API that's hosted in Azure and secured using AAD bearer token authentication to allow a client application (currently just a test console app I built) to access it.
A requirement has come to light that users of the eventual client application (Sharepoint) will fall into 2 separate groups - access to certain areas of the API will be restricted for one of them.
My boss has stipulated that the API should handle all authentication so I need to swap out the current Azure Active Directory Bearer Authentication middleware and replace it with (I think) Open Id Connect Authentication.
I'm having some difficulty in putting a solution together as I'm not really clear on how/if this will work. I've been looking at the provided sample however I don't see how I can utilize it. In the sample, the users log in to the site directly but in my setup they don't log in to the API, they log in to Sharepoint which then calls out - how can the API use the
...ANSWER
Answered 2019-Nov-04 at 03:56To call the api, you will need to provide the access token which contains the permissions.
Here is the code snippet for your reference.
QUESTION
I am trying to use RBAC for authorization in Azure Web App. I am following the example as described here. But this article points to Old azure portal. How can I create and assign roles (like 'Full-Time Employee', 'Vendor' etc..) in Azure AD in new Azure Portal?
...ANSWER
Answered 2017-Oct-11 at 02:19In new portal , you could assign application role in Enterprise applications
blade after updating 'appRoles' setting with application roles in manifest .
You could refer to document for detail steps . In select Role
blade , you will find the roles you defined in manifest:
QUESTION
The graphic pretty much tells the story. This is all single tenant, fwiw.
I have my Web API, which is being accessed by a "swagger" UI (which is really a kind of spa) served up from the same location, as well as an MVC app, which has some traditional MVC controllers interacting with the Web API, as well as some SPA experiences that interact directly with the web api.
From what I've read, in addition to my Web API having an app registration in my AD tenant (which has the roles declared in it's manifest in order to support RBAC), I also need to have a separate app registration for the swagger UI, which is granted permissions to access the Web API.
I'm unsure if my MVC app needs 1 AD Tenant registration, or 2 registrations (1 for MVC, 1 for the SPA served up from MVC)
Main questions..
Should my MVC/SPA share the same AD registration, or, they should be separated?
Does my Web API registration's manifest need to have
"oauth2AllowImplicitFlow": true
, or only the swagger and SPA app registrations' manifest need that?My MVC, based on this github sample for SPAs, currently uses this middleware:
app.UseWindowsAzureActiveDirectoryBearerAuthentication
.. but if my MVC is going to do selective things in it's razor or with it's contoller logic, should I also be using these add'l middlewaresUseCookieAuthentication
andUseOpenIdConnectAuthentication
as shown in this non-SPA web app sample
ANSWER
Answered 2017-Jun-21 at 19:32- You can probably make it work with the same application (getting the access token server-side and supplying it with the rendered page), but you might run into a few things where you can't use that token to get a token to go to the next app (the WebAPI one). It does mean a potential extra trip to Azure AD, but I'd have the SPA be it's own app.
- Only the Swagger and SPA registrations need
"oauth2AllowImplicitFlow": true
. - Your MVC app should not use the bearer auth middleware - it should use the normal OpenIdConnect one. The only app in this setup that should be using bearer auth is your WebAPI one.
A couple of additional notes re: the SPA served from the MVC app. When you're making a call to the WebAPI app, you'll need to make sure a bearer auth token is included on the call, which you get using something like ADAL-JS. If/when you're making a call to the MVC app, no bearer token will be used, you'll be usually the cookie+openid authentication.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install active-directory-dotnet-webapp-roleclaims
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page