ms-identity-aspnet-webapp-openidconnect | sample showcasing how to develop a web application | Azure library
kandi X-RAY | ms-identity-aspnet-webapp-openidconnect Summary
kandi X-RAY | ms-identity-aspnet-webapp-openidconnect Summary
This sample showcases how to develop a web application that handles sign using the Microsoft identity platform. It shows you how to use the new unified signing-in model that can be used to sign-in users to the app with both their work/school account (Azure AD account) or Microsoft account (MSA). The application is implemented as an ASP.NET MVC project, while the web sign-on functionality is implemented via ASP.NET OpenId Connect OWIN middleware. The sample also shows how to use MSAL.NET (Microsoft Authentication Library) to obtain an access token for Microsoft Graph. Specifically, the sample shows how to retrieve the last email messages received by the signed in user, and how to send a mail message as the user using Microsoft Graph. Finally, the sample showcases a new capability introduced by the new Microsoft identity platform - the ability for one app to seek consent for new permissions incrementally. For more information about how the protocols work in this scenario and other scenarios, see Authentication Scenarios for Azure AD. For more information about Microsoft Graph, please visit the Microsoft Graph homepage.
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 ms-identity-aspnet-webapp-openidconnect
ms-identity-aspnet-webapp-openidconnect Key Features
ms-identity-aspnet-webapp-openidconnect Examples and Code Snippets
Community Discussions
Trending Discussions on ms-identity-aspnet-webapp-openidconnect
QUESTION
I am working on ASP.Net MVC classic application. This app get a access token to gain access the resource in the API. Once it get the access token then I want to store it and use it when I need it to call the API in different controller. However, I want to :
Store, retrieve and refresh and want to have understanding of AcquireTokenSilently().
We may get the token after user sign-in in Startup.cs and then it can be saved and retrieve to access API. So, it might be checked for expire token and then refresh or acquire token silently to access API resource. So whatever flow makes sense.
I have read several document for MSAL but did not get the clear picture and getting confused by AcquireTokenSilently(), Refresh(). Please see the below code where I am accessing token but I am not storing it.
...ANSWER
Answered 2022-Mar-07 at 17:57You don't store it. MSAL does. It has a token cache built in to it. This cache is application specific so that it will need to acquire a token the first time each application is run. You can also use a Broker to pull a token from the OS that is associated with the current user logged on.
QUESTION
I am trying out the sample code of the Microsoft identity platform to add authentication and authorization to web applications. The sample from the link (https://github.com/Azure-Samples/ms-identity-aspnet-webapp-openidconnect) is working well in IIS Express. When I try to host the same with a custom website in IIS, it is not working as expected. The steps which I have followed, and problems occurred are mentioned below.
HOSTING IN IIS EXPRESS
The index page of the sample code has Sign in with Microsoft button
When clicking Sign in with Microsoft, it prompts for the username and password.
After entering the credentials, the index page is updated with the logged-in username
HOSTING IN CUSTOM IIS WEBSITE
The same application is hosted in a custom website in IIS. Here also while clicking the Sign in with Microsoft, it prompts for username and password
After entering the username and password, it is being redirected to the index page.
But the issue occurring is that the username is not updated and again showing the Sign in with Microsoft as the ClaimsPrincipal class cannot get the username
I cannot understand why this is happening meanwhile the same app is working well in IIS Express. Please help me around this. Thank you.
...ANSWER
Answered 2020-Aug-27 at 07:25With the help of Microsoft azure dev support I was able to find the root cause. We have to have slash(/) at the end of the redirect-uri value like the below one.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install ms-identity-aspnet-webapp-openidconnect
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