azureasp.net-coresingle-sign-onrazor-pages.net-8.0

SSO implementation in .NET 8 Razor pages web application


I need to implement SSO in our Razor pages web application, which is running on .NET 8. SSO provider is Azure AD, and it is SAML based.

I want this SSO behavior: if the user hits the url of our website, it will redirect to the SSO page, and once the user is validated there, it should redirect to one of our pages. Here I need to get the user login name, other logic I have already implemented. Please help me with this. I am totally new to SSO implementation.

Please note the Azure part is already done, I only need help writing the code.


Solution

  • You could follow official documents below:

    document1:Microsoft identity platform code samples for different web apps

    document2: Use Microsoft Identity Web to handle asp.net core web app authentication

    You could clone the sample codes with :

    git clone https://github.com/Azure-Samples/ms-identity-docs-code-dotnet.git