Authentication for Blazor server applications ecosystem

Hayk Manukyan 0 Reputation points
2023-08-04T04:14:41.6333333+00:00

Hi everyone, we are going to develop ecosystem of several Blazor server applications. Our users should have only one account when using those applications. When navigating from one application to another then they do not have to enter username and password again. The users account we would like to store in our servers instead of external for example Azure Active Directory. Please advise what will be the best method to implement such authentication mechanism?

Developer technologies | .NET | Blazor
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 77,686 Reputation points Volunteer Moderator
    2023-08-07T15:34:42.2433333+00:00

    oauth is the official single sign on for asp.net core (and blazor). this requires an oauth login server. identity server is the typical onsite server:

    https://identityserver4.readthedocs.io/en/latest/

    you may be able also use cookie login. this requires all sites have a common domain, which the cookie path can be set to. also all the sites will need data protection services configured to use a common persistent key storage.

    note: one issue you will face is cookie expiration. a typical website updates the cookie timeout doing use, but Blazor server only accesses the cookie at app startup, as Blazor server apps are just one request.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.