Skip to content
No description, website, or topics provided.
C# JavaScript HTML
Branch: master
Clone or download
Latest commit 1bfd879 Sep 26, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Adds SessionStateChangedEventAsync. Adds Processing Status Return Inv… Sep 25, 2019
src Fixes aud issue. Sep 25, 2019
.gitignore first commit Sep 24, 2019
LICENSE first commit Sep 24, 2019 Small imprecision correction Sep 25, 2019


This is a library for Blazor authentication with OpenId Authorization Code-Grantflow, using IdenityServer or other OpenId providers and Silent Refresh for Blazor over .NET Core v3.0.0 client & server-side solutions, the idea behind this is to have an easy way of using OpenId services in Blazor without the need of the js library.




You'll want to follow the Getting Started instructions in Blazor website

IdenityServer or Another OpenId Server

You need need to setup and configure OpenId Server. By default Blazor.OpenId redirects to the root of your application.


Install via Nuget.

Server Side

Install-Package Blazor-OpenId  


Note: Following example is for a server-side with require authenticated user implementation, for client-side and core-hosted example implementations please refer to the examples


// Import Blazor.Auth0
using Blazor.Auth0;
using Blazor.Auth0.Models;
// ...

public void ConfigureServices(IServiceCollection services)
	// Other code...

	/// This one-liner will initialize Blazor.Auth0 with all the defaults
	    services.AddBlazorOpenid(options =>
                options.Domain = "[Your-Domain]";
                options.ClientId = "[Your-Client-Id]";
                options.SlidingExpiration = true;
                options.Scope = "[Your-Scopes]";  // By default openid profile email
                options.RequestMode = Blazor.OpenId.Models.RequestModes.Form_Post;

	// Other code...

Replace App.razor content with the following code


<Router AppAssembly="@typeof(Program).Assembly">
    <Found Context="routeData">
        <AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
                <p>>Determining session state, please wait...</p>
                <p>You're not authorized to reach this page. You may need to log in as a different user.</p>
        <p>Sorry, there's nothing at this address.</p>        


John J Bomhold - OpenId implementation of Auth0

Blazor.Auth0 was created by Henry Alberto Rodriguez - GitHub - Twitter - Linkedin


This project is licensed under the MIT License - see the LICENSE file for details.

You can’t perform that action at this time.