All Projects → henalbrod → Blazor.auth0

henalbrod / Blazor.auth0

Licence: mit
The library for using Auth0 in Blazor applications.

Programming Languages

csharp
926 projects

Projects that are alternatives of or similar to Blazor.auth0

Lock.swift
A Swift & iOS framework to authenticate using Auth0 and with a Native Look & Feel
Stars: ✭ 215 (+93.69%)
Mutual labels:  oauth2, auth0
Supertokens Core
Open source alternative to Auth0 / Firebase Auth / AWS Cognito
Stars: ✭ 2,907 (+2518.92%)
Mutual labels:  oauth2, auth0
Assent
Multi-provider framework in Elixir
Stars: ✭ 126 (+13.51%)
Mutual labels:  oauth2, auth0
Cloudfront Auth
An AWS CloudFront [email protected] function to authenticate requests using Google Apps, Microsoft, Auth0, OKTA, and GitHub login
Stars: ✭ 471 (+324.32%)
Mutual labels:  oauth2, auth0
remix-auth
Simple Authentication for Remix
Stars: ✭ 929 (+736.94%)
Mutual labels:  oauth2, auth0
Authing
🔥Authing - IDaaS/IAM solution that can Auth to web and mobile applications.
Stars: ✭ 247 (+122.52%)
Mutual labels:  oauth2, auth0
Auth0.swift
Swift toolkit for Auth0 API
Stars: ✭ 146 (+31.53%)
Mutual labels:  oauth2, auth0
Samples.aspnetcore Identityserver4
IdentityServer4 sample with .NET Core and ASP.NET Core 2.0
Stars: ✭ 115 (+3.6%)
Mutual labels:  dotnetcore, oauth2
ertis-auth
Generic token generator and validator service like auth
Stars: ✭ 28 (-74.77%)
Mutual labels:  oauth2, auth0
Auth0.js
Auth0 headless browser sdk
Stars: ✭ 755 (+580.18%)
Mutual labels:  oauth2, auth0
Handsup React
HandsUp 🙌 - Make your events more interactive
Stars: ✭ 99 (-10.81%)
Mutual labels:  auth0
Auth0
Authentication in shinyapps using Auth0 service
Stars: ✭ 100 (-9.91%)
Mutual labels:  auth0
Django Oauth2 Server
OAuth2 server written in Python with Django
Stars: ✭ 108 (-2.7%)
Mutual labels:  oauth2
Taskpad
app to enter your daily tasks and tag them
Stars: ✭ 109 (-1.8%)
Mutual labels:  auth0
Mean Rsvp Auth0
MEAN stack application with Auth0 (see sample deployed at https://rsvp.kmaida.net)
Stars: ✭ 99 (-10.81%)
Mutual labels:  auth0
Flask Oauthlib
YOU SHOULD USE https://github.com/lepture/authlib
Stars: ✭ 1,429 (+1187.39%)
Mutual labels:  oauth2
Django Auth0 Vue
A Django REST Framework + Vue.js CRUD Demo Secured Using Auth0
Stars: ✭ 99 (-10.81%)
Mutual labels:  auth0
Newschool Backend
Plataforma de ensino para pessoas carentes
Stars: ✭ 98 (-11.71%)
Mutual labels:  oauth2
Vue Authenticate
Simple Vue.js authentication library
Stars: ✭ 1,350 (+1116.22%)
Mutual labels:  oauth2
Laqul
A complete starter kit that allows you create amazing apps that look native thanks to the Quasar Framework. Powered by an API developed in Laravel Framework using the easy GraphQL queries language. And ready to use the Google Firebase features.
Stars: ✭ 110 (-0.9%)
Mutual labels:  oauth2

Blazor.Auth0

Blazor Auth0 Library

Blazor.Auth0 Is a library for using the Authorization Code Grant with Proof Key for Code Exchange (PKCE) with Auth0's Universal Login in Blazor SPAs.

The idea behind this is to have an easy way of using Auth0's services with Blazor (especially the client side) without relaying on javascript libraries.

Nuget Nuget Github Actions Codacy Badge GitHub license

About Auth0

Auth0 is a platform that provides authentication and authorization as a service. Giving developers and companies the building blocks they need to secure their applications without having to become security experts.

You can connect any application (written in any language or on any stack) to Auth0 and define the identity providers you want to use (how you want your users to log in).

Learn more at:

JWT Auth for open source projects

Prerequisites

Blazor

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

Auth0

Basic knowledge of Auth0 IDaaS platform is assumed, otherwise, visiting Auth0 docs is highly recommended.

Installation

Install via Nuget.

Server Side

Install-Package Blazor-Auth0-ServerSide -Version 2.0.0-Preview5

Client Side

Install-Package Blazor-Auth0-ClientSide -Version 2.0.0-Preview5

Usage

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

Program.cs


using Blazor.Auth0;

// ...


public static async Task Main(string[] args)
{
	var builder = WebAssemblyHostBuilder.CreateDefault(args);

	builder.Services.AddBlazorAuth0(options =>
	{
		// Required
		options.Domain = "[Auth0_Domain]";

		// Required
		options.ClientId = "[Auth0_Client_Id]";

		//// Required if you want to make use of Auth0's RBAC
		options.Audience = "[Auth0_Audience]";

		//// Uncomment the following line if you don't want your users to be automatically logged-off on token expiration
		// options.SlidingExpiration = true;

		//// Uncomment the following two lines if you want your users to log in via a pop-up window instead of being redirected
		// options.LoginMode = LoginModes.Popup;

		//// Uncomment the following line if you don't want your unauthenticated users to be automatically redirected to Auth0's Universal Login page 
		// options.RequireAuthenticatedUser = false;
	});
	
	builder.Services.AddAuthorizationCore();

	builder.RootComponents.Add<App>("app");

	await builder.Build().RunAsync();
}

Add a reference to Microsoft.AspNetCore.Components.Authorization

_Imports.razor

@using Microsoft.AspNetCore.Components.Authorization
//...

Replace App.razor content with the following code

App.razor

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

Support

If you found a bug, have a consultation or a feature request please feel free to open an issue.

When opening issues please take in account to:

  • Avoid duplication: Please search for similar issues before.
  • Be specific: Please don't put several problems/ideas in the same issue.
  • Use short descriptive titles: You'll have the description box to explain yourself.
  • Include images whenever possible: A picture is worth a thousand words.
  • Include reproduction steps for bugs: Will be appreciated

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

  1. Fork it (https://github.com/henalbrod/Blazor.Auth0/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

Authors

Henry Alberto Rodriguez - Initial work - GitHub - Twitter - Linkedin

License

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

Acknowledgments

Release History

v2.0.0-Preview5

  • Fixed issue #41
  • Upgraded to .Net Core v3.1.102

v2.0.0-Preview4

  • Upgraded to .Net Core v3.1.0-preview3

v2.0.0-Preview3

  • Upgraded to .Net core 3.1.0-preview2

v2.0.0-Preview2

This relase comes with Client Side changes primarly

  • New LoginMode parameter in ClientOptions

    Redirect = Classic behavior (default) PopUp = Loads Universal Login inside a popup window

    The new PopUp behavior comes in handy to avoid the full client side app reloading

  • New AuthorizePopup method in Blazor.Auth0.Authentication for client side

v2.0.0-Preview1

BREAKING CHANGES:

  • Upgraded to .Net Core 3.1.0-preview1
  • Server side projects upgraded to netcoreapp3.1
  • Auth0 permissions are now accesible as an any other array claim:
policy.RequireClaim("permissions", "permission_name")

v1.0.0-Preview3

  • Overall upgrade to .Net Core 3.0

v1.0.0-Preview2

  • Overall upgrade to .Net Core 3.0 RC1
  • Removed Shell.razor in Example projects
  • Simplified App.razor in Example projects
  • Removed local _imports.razor in Example projects

v0.1.0.0-Preview1

  • Upgraded to .Net Core 3.0.0-preview8
  • Removed AuthComponent
  • New One-Liner instantiation
  • Server Side full rewrite
    • Better server-side Blazor Authentication compatibility/integration
    • Cookie-based session (No more silent login iframe in server-side)
    • Refresh token support (Refreshing and Revoking)
    • Client secret
    • Server-side sliding expiration
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].