close

Code Samples

Experience the identity and security features of Auth0
Filters
actix-web
rust
Actix Web/Rust API:Authorization Code Sample
Code sample of a simple Actix Web server that implements token-based authorization using Auth0.
actix-web
rust
Actix Web/Rust API:Role-Based Access Control Code Sample
Code sample of a simple Actix Web server that implements Role-Based Access Control (RBAC) using Auth0.
aspnet-core
csharp
ASP.NET Core Code Sample:Web API Authorization
Code sample of a simple ASP.NET Core server that implements token-based authorization using Auth0.
aspnet-core
csharp
ASP.NET Core v5 Code Sample:Web API Authorization
Code sample of a simple ASP.NET Core v5.0 server that implements token-based authorization using Auth0.
aspnet-core
csharp
ASP.NET Core Code Sample:Web API Role-Based Access Control
Code sample of a simple ASP.NET Core server that implements Role-Based Access Control (RBAC) using Auth0.
aspnet-core
csharp
ASP.NET Core v5 Code Sample:Web API Role-Based Access Control
Code sample of a simple ASP.NET Core v5.0 server that implements Role-Based Access Control (RBAC) using Auth0.
django
python
Django/Python API:Authorization Code Sample
Code sample of a simple Django server that implements token-based authorization using Auth0.
django
python
Django/Python API:Role-Based Access Control Code Sample
Code sample of a simple Django server that implements Role-Based Access Control (RBAC) using Auth0.
express
javascript
Express.js Code Sample:Basic API Authorization
Code sample of a simple Express.js server that implements token-based authorization using Auth0.
express
typescript
Express.js/TypeScript Code Sample:Basic API Authorization
Code sample of a simple Express.js server built with TypeScript that implements token-based authorization using Auth0.
express
javascript
Express.js Code Sample:API Role-Based Access Control
Code sample of a simple Express.js server built with JavaScript that implements Role-Based Access Control (RBAC) using Auth0.
express
typescript
Express.js/TypeScript Code Sample:API Role-Based Access Control
Code sample of a simple Express.js server built with TypeScript that implements Role-Based Access Control (RBAC) using Auth0.
fastapi
python
FastAPI/Python Code Sample:Basic API Authorization
Code sample of a simple FastAPI server that implements token-based authorization using Auth0.
fastapi
python
FastAPI/Python Code Sample:API Role-Based Access Control
Code sample of a simple FastAPI server that implements Role-Based Access Control (RBAC) using Auth0.
flask
python
Flask/Python API:Authorization Code Sample
Code sample of a simple Flask server that implements token-based authorization using Auth0.
flask
python
Flask/Python API:Role-Based Access Control Code Sample
Code sample of a simple Flask server that implements Role-Based Access Control (RBAC) using Auth0.
laravel
php
Laravel/PHP Code Sample:Basic API Authorization with Auth0 Laravel SDK
Code sample of a simple Laravel server that implements token-based authorization using the Auth0 Laravel SDK.
laravel
php
Laravel/PHP Code Sample:Basic API Authorization with Auth0 PHP SDK
Code sample of a simple Laravel server that implements token-based authorization using the Auth0 PHP SDK.
laravel
php
Laravel/PHP Code Sample:API Role-Based Access Control with Auth0 Laravel SDK
Code sample of a simple Laravel server that implements Role-Based Access Control (RBAC) using the Auth0 Laravel SDK.
laravel
php
Laravel/PHP Code Sample:API Role-Based Access Control with Auth0 PHP SDK
Code sample of a simple Laravel server that implements Role-Based Access Control (RBAC) using the Auth0 PHP SDK.
lumen
php
Lumen Code Sample:Basic API Authorization
Code sample of a simple Lumen server that implements token-based authorization using Auth0.
lumen
php
Lumen Code Sample:API Role-Based Access Control
Code sample of a simple Lumen server that implements Role-Based Access Control (RBAC) using Auth0.
nestjs
typescript
NestJS Code Sample:Basic API Authorization
Code sample of a simple NestJS server that implements token-based authorization using Auth0.
nestjs
typescript
NestJS Code Sample:API Role-Based Access Control
Code sample of a simple NestJS server built with TypeScript that implements Role-Based Access Control (RBAC) using Auth0.
phoenix
elixir
Phoenix/Elixir API:Authorization Code Sample
Code sample of a simple Phoenix server that implements token-based authorization using Auth0.
phoenix
elixir
Phoenix/Elixir API:Role-Based Access Control Code Sample
Code sample of a simple Phoenix server that implements Role-Based Access Control (RBAC) using Auth0.
rails
ruby
Ruby on Rails API:Authorization Code Sample
Code sample of a simple Rails server that implements authorization using Auth0.
rails
ruby
Ruby on Rails API:Role-Based Access Control Code Sample
Code sample of a simple Rails server that implements Role-Based Access Control (RBAC) using Auth0.
spring
java
Spring Code Sample:Basic API Authorization
Java code sample that implements token-based authorization in a Spring Web API server to protect API endpoints, using Spring Security and the Okta Spring Boot Starter.
spring
java
Spring Functional Code Sample:Basic API Authorization
Java code sample that implements token-based authorization in a Spring Web API server to protect API endpoints, following a functional approach.
spring
java
Spring Code Sample:API Role-Based Access Control
Java code sample that implements Role-Based Access Control (RBAC) in a Spring Web API server to protect endpoints, using Spring Security and the Okta Spring Boot Starter.
spring
java
Spring Functional Code Sample:API Role-Based Access Control
Java code sample that implements Role-Based Access Control (RBAC) in a Spring Web API server to protect API endpoints, following a functional approach.
spring-webflux
java
Spring WebFlux Code Sample:Basic API Authorization
Java code sample that implements token-based authorization in a Spring WebFlux API server to protect API endpoints, using Spring Security and the Okta Spring Boot Starter.
spring-webflux
java
Spring WebFlux Code Sample:API Role-Based Access Control
Java code sample that implements Role-Based Access Control (RBAC) in a Spring WebFlux API server to protect endpoints, using Spring Security and the Okta Spring Boot Starter.
standard-library
golang
Golang Code Sample:Basic API Authorization
Code sample of a simple Golang server that implements token-based authorization using Auth0.
standard-library
golang
Golang Code Sample:API Role-Based Access Control
Code sample of a simple Golang server that implements Role-Based Access Control (RBAC) using Auth0.
symfony
php
Symfony Code Sample:Basic API Authorization
Code sample of a simple Symfony server that implements token-based authorization using Auth0.
symfony
php
Symfony Code Sample:API Role-Based Access Control
Code sample of a simple Symfony server that implements Role-Based Access Control (RBAC) using Auth0.
angular
typescript
Angular Standalone Components Code Sample:Basic Authentication
This code sample uses Angular Standalone Components with TypeScript to implement single-page application authentication using the Auth0 Angular SDK.
angular
typescript
Angular Code Sample:Basic Authentication
This code sample uses Angular with TypeScript to implement single-page application authentication using the Auth0 Angular SDK.
react
javascript
React Router 6 Code Sample:Basic Authentication
Code sample showing how to protect a simple React single-page application using React Router 6, Auth0, and JavaScript.
react
typescript
React Router 6/TypeScript Code Sample:Basic Authentication
Code sample showing how to protect a simple React single-page application using React Router 6, Auth0, and TypeScript.
react
javascript
React Code Sample:Basic Authentication
JavaScript code that implements user login, logout and sign-up features to secure a React Single-Page Application (SPA) using Auth0.
react
typescript
React/TypeScript Code Sample:Basic Authentication
Code sample of a simple React single-page application built TypeScript that implements authentication using Auth0.
svelte
javascript
Svelte Code Sample:Basic Authentication
JavaScript code that implements user login, logout and sign-up features to secure a Svelte Single-Page Application (SPA), using routing middleware.
vue
javascript
Vue.js Composition API Code Sample:Basic Authentication
This code sample uses Vue.js 3 with JavaScript and the Composition API to implement single-page application authentication using the Auth0 Vue SDK.
vue
javascript
Vue.js Options API Code Sample:Basic Authentication
This code sample uses Vue.js 3 with JavaScript and the Options API to implement single-page application authentication using the Auth0 Vue SDK.
vue
javascript
Vue.js 2 Code Sample:Basic Authentication
This code sample uses Vue.js 2 with JavaScript to implement single-page application authentication using the Auth0 SPA SDK.
aspnet-core
csharp
ASP.NET Core Code Sample:Basic Authentication
This code sample uses ASP.NET Core to implement web application authentication using the Auth0 SDK for ASP.NET Core.
aspnet-core
csharp
ASP.NET Core v5 Code Sample:Basic Authentication
This code sample uses ASP.NET Core v5 to implement web application authentication using the Auth0 SDK for ASP.NET Core.
laravel
php
Laravel Code Sample:Basic Authentication
Code sample of a simple Laravel web application built with PHP that implements authentication using Auth0.
nextjs
javascript
Next.js/JavaScript App Router Code Sample:Basic Authentication
Code sample of a simple Next.js web application built with JavaScript that implements authentication using Auth0 and Next.js App Router.
nextjs
javascript
Next.js/JavaScript Pages Router Code Sample:Basic Authentication
Code sample of a simple Next.js web application built with JavaScript that implements authentication using Auth0 and Next.js Pages Router.
nextjs
typescript
Next.js/TypeScript Pages Router Code Sample:Basic Authentication
Code sample of a simple Next.js web application built with TypeScript that implements authentication using Auth0 and Next.js Pages Router.
rails
ruby
Ruby on Rails Code Sample:Basic Authentication
This code sample uses Ruby on Rails to implement web application authentication using the Ruby on Rails Auth0 SDK.
spring
java
Spring MVC Code Sample:Basic Authentication
Code sample of a simple Spring MVC web application built with Java that implements authentication using Auth0 and Spring Security and the Okta Spring Boot Starter.
symfony
php
Symfony Code Sample:Basic Authentication
Code sample of a simple Symfony web application built with PHP that implements authentication using Auth0.
Ready to secure your apps?
Get Auth0 for free with up to 7,500 active users and unlimited logins. No credit card required.