### Basic SsoProviderCreate Page Setup Source: https://auth0.com/docs/get-started/universal-components/web/components/sso-provider-create A minimal example of setting up the SsoProviderCreate component with basic navigation actions. ```typescript import { SsoProviderCreate } from "@auth0/universal-components-react"; import { useRouter } from "next/navigation"; export function CreateProviderPage() { const router = useRouter(); return ( router.push("/providers/list"), }} backButton={{ onClick: () => router.push("/providers/list"), }} /> ); } ``` -------------------------------- ### Beta Quickstart Announcement Source: https://auth0.com/docs/quickstart/webapp/express This callout informs users about a new Beta version of the quickstart using the `@auth0/auth0-express` SDK, which is intended to replace the current guide. ```html A new **Beta** version of this quickstart is available using the `@auth0/auth0-express` SDK, which will soon replace this guide. [Try the Beta quickstart β†’](/docs/quickstart/webapp/express-beta) ``` -------------------------------- ### Auth0 Setup for MacOS Source: https://auth0.com/docs/quickstart/spa/capn-web This command installs the Auth0 CLI, logs you in, creates an Auth0 API and application, and configures your .env file with the necessary Auth0 details. It assumes you are using Homebrew for installation. ```bash AUTH0_APP_NAME="My Cap'n Web App" && AUTH0_API_NAME="Cap'n Web API" && AUTH0_API_IDENTIFIER="https://capnweb-api.$(date +%s).com" && brew tap auth0/auth0-cli && brew install auth0 && auth0 login --no-input && auth0 apis create --name "${AUTH0_API_NAME}" --identifier "${AUTH0_API_IDENTIFIER}" --scopes "read:profile,write:profile" --json > auth0-api-details.json && auth0 apps create -n "${AUTH0_APP_NAME}" -t spa -c http://localhost:3000 -l http://localhost:3000 -o http://localhost:3000 --json > auth0-app-details.json && CLIENT_ID=$(jq -r '.client_id' auth0-app-details.json) && DOMAIN=$(auth0 tenants list --json | jq -r '.[] | select(.active == true) | .name') && echo "AUTH0_DOMAIN=${DOMAIN}" > .env && echo "AUTH0_CLIENT_ID=${CLIENT_ID}" >> .env && echo "AUTH0_AUDIENCE=${AUTH0_API_IDENTIFIER}" >> .env && echo "PORT=3000" >> .env && echo "NODE_ENV=development" >> .env && rm auth0-app-details.json auth0-api-details.json && echo ".env file created with your Auth0 details:" && cat .env ``` -------------------------------- ### Example Get User Implementation Source: https://auth0.com/docs/authenticate/database-connections/custom-db/templates/get-user A pseudo-JavaScript example demonstrating how to implement the 'getUser' function. It shows sending a request to an external API and handling the response to return user profile data or an error. ```javascript function getUser(email, callback) { // Send user identifier to external database API let options = { url: "https://example.com/api/search-users", body: { email: email } }; send(options, (err, profileData) => { // Return error in callback if there was an issue finding the user if (err) { return callback(new Error("Could not determine if user exists or not.")); } else { // Return null in callback if user was not found, return profile data in callback if user was found if (!profileData) { return callback(null); } else { let profile = { email: profileData.email, user_id: profileData.userId }; return callback(null, profile); } } }); } ``` -------------------------------- ### Install Auth0 Agent Skills CLI Source: https://auth0.com/docs/troubleshoot/customer-support/auth0-changelog Use this command to install Auth0 Agent Skills via the command line interface. This is the recommended method for integrating Agent Skills into your development workflow. ```bash npx skills add auth0/agent-skills ``` -------------------------------- ### Get Job by ID - Ruby Source: https://auth0.com/docs/api/management/v2/jobs/get-jobs-by-id This Ruby example demonstrates fetching a job by its ID. Ensure you have the Auth0 Ruby gem installed and provide a valid token. ```ruby require "auth0" client = Auth0::Management.new(token: "") client.jobs.get(id: "id") ``` -------------------------------- ### Signup Constructor and Method Example Source: https://auth0.com/docs/libraries/acul/js-sdk/Screens/classes/Signup Demonstrates how to create an instance of the Signup class and use its signup method to initiate the signup process. ```APIDOC ## Signup Describes all the properties and methods available to customize the Universal Login `signup` screen. The Signup class implements the `signup` screen functionality. This screen collects the user’s credentials to create a new account. Depending on your tenant, the identifier can be an email, phone number, or username. It also supports federated signup via social or enterprise connections and Google One Tap. ### Constructor Create an instance of Signup screen manager: ```javascript import Signup from '@auth0/auth0-acul-js/signup'; const signupManager = new Signup(); signupManager.signup({ email: 'test@example.com', password: 'P@$wOrd123!', }); ``` ### Properties * **branding**: BrandingMembers - Provides branding-related configurations, such as branding theme and settings. * **client**: ClientMembers - Provides client-related configurations, such as `id`, `name`, and `logoUrl`, for the `signup` screen. * **organization**: OrganizationMembers - Provides information about the user’s Organization, such as `id` and `name`. * **prompt**: PromptMembers - Contains data about the current prompt in the authentication flow. * **screen**: ScreenMembersOnSignup - Contains details specific to the `signup` screen, including its configuration and context. * **tenant**: TenantMembers - Contains data related to the tenant, such as `id` and associated metadata. * **transaction**: TransactionMembersOnSignup - Provides transaction-specific data, such as active identifiers and flow states. * **untrustedData**: UntrustedDataMembers - Handles untrusted data passed to the SDK, such as user input during login. * **user**: UserMembers - Details of the active user, including `username`, `email`, and `roles`. ``` -------------------------------- ### PHP Login Integration Example Source: https://auth0.com/docs/quickstart/webapp/php/interactive This snippet demonstrates a basic PHP setup for integrating Auth0 login. It assumes you have the Auth0 PHP SDK installed and configured. ```php 'YOUR_AUTH0_DOMAIN', 'client_id' => 'YOUR_AUTH0_CLIENT_ID', 'client_secret' => 'YOUR_AUTH0_CLIENT_SECRET', 'redirect_uri' => 'http://localhost:3000/callback' ]); // Initiate login $auth0->login(); ?> Login ``` -------------------------------- ### Install and Run Application Source: https://auth0.com/docs/secure/data-privacy-and-compliance/gdpr/gdpr-track-consent-with-lock Install project dependencies and run the application locally. ```bash npm install npm run ``` -------------------------------- ### Set Session Metadata in Auth0 Actions Source: https://auth0.com/docs/troubleshoot/customer-support/auth0-changelog Use `api.session.setMetadata(key, value)` to attach custom data to a user's session. This example sets device name, login region, and organization context. ```javascript exports.onExecutePostLogin = async (event, api) => { api.session.setMetadata("deviceName", event.request.user_agent); api.session.setMetadata("loginRegion", event.request.geoip?.countryCode); api.session.setMetadata("orgContext", event.organization?.id); }; ``` -------------------------------- ### Get Client by ID in Go Source: https://auth0.com/docs/api/management/v2/clients/get-clients-by-id Fetch a client by its ID using the Auth0 Go SDK. This example demonstrates the basic setup for making the API call. ```go package example import ( context "context" management "github.com/auth0/go-auth0/management/management" client "github.com/auth0/go-auth0/management/management/client" option "github.com/auth0/go-auth0/management/management/option" ) ``` -------------------------------- ### Main Server Entry Point in Go Source: https://auth0.com/docs/quickstart/backend/golang Sets up the HTTP server, including loading configuration, creating JWT validators and middleware, defining routes, and implementing graceful shutdown. ```go package main import ( "context" "log" "net/http" "os" "os/signal" "time" "github.com/yourorg/myapi/internal/auth" "github.com/yourorg/myapi/internal/config" "github.com/yourorg/myapi/internal/handlers" "github.com/joho/godotenv" ) func main() { // Load environment variables from .env file if err := godotenv.Load(); err != nil { log.Println("No .env file found, using environment variables") } // Load Auth0 configuration cfg, err := config.LoadAuthConfig() if err != nil { log.Fatalf("Failed to load config: %v", err) } // Create JWT validator jwtValidator, err := auth.NewValidator(cfg.Domain, cfg.Audience) if err != nil { log.Fatalf("Failed to create validator: %v", err) } // Create HTTP middleware middleware, err := auth.NewMiddleware(jwtValidator) if err != nil { log.Fatalf("Failed to create middleware: %v", err) } // Setup routes mux := http.NewServeMux() mux.HandleFunc("/api/public", handlers.PublicHandler) mux.Handle("/api/private", middleware.CheckJWT(http.HandlerFunc(handlers.PrivateHandler))) mux.Handle("/api/private-scoped", middleware.CheckJWT(http.HandlerFunc(handlers.ScopedHandler))) // Configure server with production timeouts srv := &http.Server{ Addr: ":8080", Handler: mux, ReadTimeout: 15 * time.Second, WriteTimeout: 15 * time.Second, IdleTimeout: 60 * time.Second, } // Start server in goroutine go func() { log.Println("Server starting on :8080") if err := srv.ListenAndServe(); err != nil && err != http.ErrServerClosed { log.Fatalf("Server failed: %v", err) } }() // Graceful shutdown quit := make(chan os.Signal, 1) signal.Notify(quit, os.Interrupt) <-quit log.Println("Shutting down server...") ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) defer cancel() if err := srv.Shutdown(ctx); err != nil { log.Fatalf("Server forced to shutdown: %v", err) } log.Println("Server exited") } ``` -------------------------------- ### Get Connection Keys (Go) Source: https://auth0.com/docs/api/management/v2/connections/get-keys This Go code example demonstrates how to fetch connection keys via the Auth0 Management API. Ensure you have the go-auth0 SDK installed. ```go package example import ( context "context" client "github.com/auth0/go-auth0/management/management/client" option "github.com/auth0/go-auth0/management/management/option" ) func do() { client := client.NewClient( option.WithToken( "", ), ) client.Connections.Keys.Get( context.TODO(), "id", ) } ``` -------------------------------- ### Auth0 App Setup via Quick Setup Source: https://auth0.com/docs/quickstart/webapp/nextjs Use the Auth0 Quick Setup tool to create a new Auth0 application and automatically configure it for your Next.js project. This is the recommended approach. ```shellscript ``` -------------------------------- ### Get Roles using Java Source: https://auth0.com/docs/api/management/v2/roles/get-roles This Java example shows the initialization of the `ManagementApi` client and the creation of a `ListRolesRequestParameters` object for fetching roles. It's a starting point for integrating role management into your Java applications. ```java package com.example.usage; import com.auth0.client.mgmt.ManagementApi; import com.auth0.client.mgmt.resources.roles.requests.ListRolesRequestParameters; ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://auth0.com/docs/quickstart/backend/nodejs Verify that Node.js and npm are installed and meet the version requirements for this quickstart. ```bash node --version && npm --version ``` -------------------------------- ### Manual Setup Instructions Source: https://auth0.com/docs/quickstart/spa/capn-web Follow these steps in the Auth0 dashboard to manually configure your application and API if the automatic setup is not used. ```bash echo "πŸ“‹ MANUAL SETUP REQUIRED:" echo "1. Go to https://manage.auth0.com/dashboard/" echo "2. Create Application β†’ Single Page Application" echo "3. Set Allowed Callback URLs: http://localhost:3000" echo "4. Set Allowed Logout URLs: http://localhost:3000" echo "5. Set Allowed Web Origins: http://localhost:3000" echo "6. Create API with identifier: https://capnweb-api.yourproject.com" echo "7. Add scopes: read:profile, write:profile" echo "8. Update .env file with your Domain, Client ID, and API Audience" ``` -------------------------------- ### Example config.json Source: https://auth0.com/docs/deploy-monitor/deploy-cli-tool/configure-the-deploy-cli This is an example of a configuration file for the Deploy CLI. It sets Auth0 domain, client ID, and allows deletion settings. Avoid hard-coding credentials in this file. ```json { "AUTH0_DOMAIN": "", "AUTH0_CLIENT_ID": "{yourClientId}", "AUTH0_ALLOW_DELETE": false } ``` -------------------------------- ### Get Connection by ID Response Source: https://auth0.com/docs/authenticate/identity-providers/social-identity-providers/oauth2 Example response from the GET /get-connections-by-id endpoint, showing the structure of a connection's options. ```json { "id": "[connectionID]", "options": { "email": true, "scope": [ "email", "profile" ], "profile": true }, "strategy": "google-oauth2", "name": "google-oauth2", "is_domain_connection": false, "realms": [ "google-oauth2" ] } ``` -------------------------------- ### Install Simple PHP Router Source: https://auth0.com/docs/quickstart/backend/php/interactive Install the Simple PHP Router using Composer. This simplifies application routing for the quickstart. ```bash composer require steampixel/simple-php-router ``` -------------------------------- ### Clone and Run Sample Application Source: https://auth0.com/docs/quickstart/backend/aspnet-core-webapi Clone the sample application repository from GitHub, navigate to the playground directory, update your Auth0 configuration in appsettings.json, and run the application using the .NET CLI. ```bash git clone https://github.com/auth0/aspnetcore-api.git cd aspnetcore-api/Auth0.AspNetCore.Authentication.Api.Playground # Update appsettings.json with your Auth0 configuration dotnet run ``` -------------------------------- ### Install Auth0 Plugin for Claude Code (Terminal) Source: https://auth0.com/docs/quickstart/agent-skills Install the Auth0 agent skill directly from your terminal without starting a Claude Code session. This requires the Claude CLI to be installed. ```bash claude plugin marketplace update claude-plugins-official claude plugin install auth0@claude-plugins-official ``` -------------------------------- ### Initialize Go Project and Install Dependencies Source: https://auth0.com/docs/quickstart/backend/golang Create a new Go project directory, initialize a Go module, and install the go-jwt-middleware and godotenv packages. Ensure you have Go 1.24 or newer installed. ```shellscript mkdir myapi && cd myapi go mod init github.com/yourorg/myapi go get github.com/auth0/go-jwt-middleware/v3 go get github.com/joho/godotenv go mod download ``` -------------------------------- ### Get Organization Connection Example Source: https://auth0.com/docs/api/management/v2/organizations/get-organization-connection This example demonstrates how to retrieve a specific connection for an organization. Ensure you have the necessary scopes, such as 'read:organization_connections'. ```javascript import { ManagementClient } from "@auth0/management-api"; const management = new ManagementClient({ domain: "YOUR_DOMAIN", token: "YOUR_TOKEN", }); const organizationId = "YOUR_ORGANIZATION_ID"; const connectionId = "YOUR_CONNECTION_ID"; management.organizations.getConnection( { id: organizationId, connection_id: connectionId }, (err, orgConnection) => { if (err) { console.error("Error retrieving organization connection:", err); return; } console.log("Organization Connection:", orgConnection); } ); ``` -------------------------------- ### Start the Server and Log Configuration Source: https://auth0.com/docs/quickstart/spa/capn-web Starts the HTTP server and logs the server's running address and Auth0 configuration details to the console. ```javascript // Start server server.listen(PORT, () => { console.log(`πŸš€ Cap'n Web Auth0 Server Started`); console.log(`πŸ“ Server running on http://localhost:${PORT}`); console.log(`πŸ” Auth0 Domain: ${AUTH0_DOMAIN}`); console.log(`πŸ†” Client ID: ${AUTH0_CLIENT_ID.substring(0, 8)}...`); console.log(`🎯 API Audience: ${AUTH0_AUDIENCE}`); }); ``` -------------------------------- ### Create Client in Python Source: https://auth0.com/docs/api/management/v2/clients/post-clients This Python example demonstrates creating a client. Ensure you have the auth0-python SDK installed and provide your management API token. ```python from auth0.management import ManagementClient client = ManagementClient( token="", ) client.clients.create( name="name", ) ``` -------------------------------- ### Get CAPTCHA Configuration (Java) Source: https://auth0.com/docs/api/management/v2/attack-protection/get-captcha This Java example shows how to get the CAPTCHA configuration using the Auth0 Management API. A valid token is required. ```java package com.example.usage; import com.auth0.client.mgmt.ManagementApi; public class Example { public static void main(String[] args) { ManagementApi client = ManagementApi .builder() .token("") .build(); client.attackProtection().captcha().get(); } } ``` -------------------------------- ### Create Function Implementation Example Source: https://auth0.com/docs/authenticate/database-connections/custom-db/templates/create A pseudo-JavaScript example demonstrating how to implement the `create` function. It shows sending user data, hashing the password, and handling API responses and errors via a callback. ```javascript function create(user, callback) { // Send user profile data to external database API let hashedPassword = hash(user.password); let options = { url: "https://example.com/api/create", body: { email: user.email, username: user.username, password: hashedPassword } }; send(options, err => { // Return error in callback if user already exists if (err && err.id === "USER_ALREADY_EXISTS") { return callback(new ValidationError("user_exists", "My custom error message.")); } else if (err) { // Return error in callback if error occurred return callback(new Error("My custom error message.")); } // Return `null` value in callback if user creation operation succeeded return callback(null); }); } ``` -------------------------------- ### Verify Flutter and Dart Installation Source: https://auth0.com/docs/quickstart/spa/flutter Before starting the integration, verify that you have Flutter and Dart installed and configured for web development. This command checks your current versions. ```bash flutter --version ``` -------------------------------- ### Create ASP.NET Core MVC Project Source: https://auth0.com/docs/ja-jp/quickstart/webapp/aspnet-core Create a new ASP.NET Core MVC project for the Quickstart. ```bash dotnet new mvc -n SampleMvcApp ``` -------------------------------- ### Create Server and Environment Files Source: https://auth0.com/docs/quickstart/backend/nodejs/interactive Create the main server file and the environment variables file. ```bash touch server.js .env ``` -------------------------------- ### Get all applications Source: https://auth0.com/docs/secure/tokens/access-tokens/management-api-access-tokens/get-management-api-access-tokens-for-production This example demonstrates how to retrieve a list of all applications using a GET request to the `/api/v2/clients` endpoint. Ensure you include your access token in the `Authorization` header. ```APIDOC ## Get all applications For example, in order to [Get all applications](https://auth0.com/docs/api/management/v2#!/Clients/get_clients) use the following: ```bash cURL curl --request GET \ --url 'https://{yourDomain}/api/v2/clients' \ --header 'authorization: Bearer {yourAccessToken}' \ --header 'content-type: application/json' ``` ```csharp C# var client = new RestClient("https://{yourDomain}/api/v2/clients"); var request = new RestRequest(Method.GET); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "Bearer {yourAccessToken}"); IRestResponse response = client.Execute(request); ``` ```go Go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{yourDomain}/api/v2/clients" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {yourAccessToken}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```java Java HttpResponse response = Unirest.get("https://{yourDomain}/api/v2/clients") .header("content-type", "application/json") .header("authorization", "Bearer {yourAccessToken}") .asString(); ``` ``` -------------------------------- ### Initialize Auth0 SDK Source: https://auth0.com/docs/quickstart/native/net-android-ios/interactive This snippet shows the initial setup for the Auth0 SDK, ensuring it's ready before use. It listens for a 'storeReady' event or initializes directly if the store is already available. ```javascript if (window.rootStore) { init(); } else { window.addEventListener("adu:storeReady", init); } return () => { window.removeEventListener("adu:storeReady", init); unsubscribe?.(); }; }, []); ``` -------------------------------- ### Get All Applications Endpoint Source: https://auth0.com/docs/secure/tokens/access-tokens/get-management-api-access-tokens-for-production Example cURL command to retrieve all applications using a Management API access token. This demonstrates how to format the request for a GET endpoint. ```cURL curl --request GET \ --url 'https://{yourDomain}/api/v2/clients' \ --header 'authorization: Bearer {yourAccessToken}' \ --header 'content-type: application/json' ``` -------------------------------- ### Marketo Get Import Lead Status Response Source: https://auth0.com/docs/customize/integrations/marketing-tool-integrations/marketo This is an example of a response from the Marketo Get Import Lead Status API, showing the completion of an import job. ```json { "requestId": "8136#146daebc2ed", "success": true, "result": [{ "batchId": 1234, "status": "Complete", "numOfLeadsProcessed": 123, "numOfRowsFailed": 0, "numOfRowsWithWarning": 0 }] } ``` -------------------------------- ### Create New Expo Project Source: https://auth0.com/docs/quickstart/native/react-native-expo/interactive Create a new Expo project for the quickstart. Use the `--template blank` flag for a clean starting point. ```bash npx create-expo-app Auth0ExpoSample --template blank cd Auth0ExpoSample ``` -------------------------------- ### Create Nuxt Project Source: https://auth0.com/docs/quickstart/webapp/nuxt Initialize a new Nuxt project for the quickstart. ```shellscript npx nuxi@latest init auth0-nuxt-app ``` -------------------------------- ### Get Prompt Settings using Ruby Source: https://auth0.com/docs/api/management/v2/prompts/get-prompts This Ruby example shows how to get prompt settings using the Auth0 Ruby gem. Initialize the client with your API token. ```ruby require "auth0" client = Auth0::Management.new(token: "") client.prompts.get_settings ``` -------------------------------- ### Set up Auth0 App and Generate .env File Source: https://auth0.com/docs/quickstart/spa/svelte Configure a new Auth0 SPA application and generate a .env file with necessary credentials using the Auth0 CLI. ```bash auth0 qs setup --app --type spa --framework svelte --build-tool vite --name "My App" --port 5173 ``` -------------------------------- ### Get All Applications with Access Token Source: https://auth0.com/docs/secure/tokens/access-tokens/management-api-access-tokens/get-management-api-access-tokens-for-production This example shows how to make a GET request to retrieve all applications using an access token. Ensure the token is correctly formatted in the 'Authorization' header. ```cURL curl --request GET \ --url 'https://{yourDomain}/api/v2/clients' \ --header 'authorization: Bearer {yourAccessToken}' \ --header 'content-type: application/json' ``` ```csharp var client = new RestClient("https://{yourDomain}/api/v2/clients"); var request = new RestRequest(Method.GET); request.AddHeader("content-type", "application/json"); request.AddHeader("authorization", "Bearer {yourAccessToken}"); IRestResponse response = client.Execute(request); ``` ```go package main import ( "fmt" "net/http" "io/ioutil" ) func main() { url := "https://{yourDomain}/api/v2/clients" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("content-type", "application/json") req.Header.Add("authorization", "Bearer {yourAccessToken}") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := ioutil.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```java HttpResponse response = Unirest.get("https://{yourDomain}/api/v2/clients") .header("content-type", "application/json") .header("authorization", "Bearer {yourAccessToken}") .asString(); ``` -------------------------------- ### Display Manual Setup Instructions Source: https://auth0.com/docs/quickstart/spa/vanillajs/interactive Outputs instructions for manually configuring Auth0 in the Auth0 Dashboard. This includes creating an application, setting callback URLs, and updating the .env.local file. ```bash echo "πŸ“‹ MANUAL SETUP REQUIRED:" echo "1. Go to https://manage.auth0.com/dashboard/" echo "2. Click 'Create Application' β†’ Single Page Application" echo "3. Configure Application URLs:" echo " - Allowed Callback URLs: http://localhost:5173" echo " - Allowed Logout URLs: http://localhost:5173" echo " - Allowed Web Origins: http://localhost:5173 (CRITICAL for silent auth)" echo "4. Update .env.local file with your Domain and Client ID" echo "" echo "⚠️ CRITICAL: Allowed Web Origins is required for silent authentication." echo " Without it, users will be logged out when they refresh the page." echo "" echo "πŸ“ NOTE: Ensure your Auth0 application is configured as 'Single Page Application'" echo " type in the Auth0 Dashboard. Other application types won't work with this SDK." ``` -------------------------------- ### Ruby: Get User's Log Events Source: https://auth0.com/docs/api/management/v2/users/get-logs-by-user This Ruby example shows how to get user log events. Initialize the Auth0::Management client with your token to make the request. ```ruby require "auth0" client = Auth0::Management.new(token: "") client.users.logs.list( id: "id", page: 1, per_page: 1, sort: "sort", include_totals: true ) ``` -------------------------------- ### Get Refresh Tokens for a User (TypeScript) Source: https://auth0.com/docs/api/management/v2/users/get-refresh-tokens-for-user This TypeScript example shows how to get refresh tokens for a user using the Auth0 Management client. Ensure you await the asynchronous call. ```typescript import { ManagementClient } from "auth0"; async function main() { const client = new ManagementClient({ token: "", }); await client.users.refreshToken.list("user_id", { from: "from", take: 1, }); } main(); ``` -------------------------------- ### Install Auth0 CLI and Set Up Project Source: https://auth0.com/docs/quickstart/native/ionic-react Install the Auth0 CLI and use it to set up your Auth0 application and generate a .env file. This command automates the creation of a native Auth0 application and provides necessary environment variables. ```shellscript # Install Auth0 CLI (if not already installed) brew tap auth0/auth0-cli && brew install auth0 # Set up Auth0 app and generate .env file auth0 qs setup --app --type native --framework ionic-react --build-tool vite --name "My Ionic React App" ``` ```powershell # Install Auth0 CLI (if not already installed) scoop bucket add auth0 https://github.com/auth0/scoop-auth0-cli.git scoop install auth0 # Set up Auth0 app and generate .env file auth0 qs setup --app --type native --framework ionic-react --build-tool vite --name "My Ionic React App" ``` -------------------------------- ### Clone and Run Sample Application Source: https://auth0.com/docs/quickstart/webapp/java-spring-boot Clone the sample application repository, configure your Auth0 settings in application.yml, and run the application using Gradle. Access the application at http://localhost:3000 to test the login flow. ```bash git clone https://github.com/auth0-samples/auth0-spring-boot-login-samples.git cd auth0-spring-boot-login-samples/mvc-login # Update src/main/resources/application.yml with your Auth0 configuration # Then run: ./gradlew bootRun ``` -------------------------------- ### Setup App Component with Auth0Provider Source: https://auth0.com/docs/quickstart/native/react-native-expo Wrap your application with `Auth0Provider` and configure your Auth0 domain and client ID. This example demonstrates a basic setup using React hooks for authentication. ```jsx import React from 'react'; import {Auth0Provider, useAuth0} from 'react-native-auth0'; import { StyleSheet, Text, View, Button, Image, ActivityIndicator, } from 'react-native'; function HomeScreen() { const {authorize, clearSession, user, isLoading} = useAuth0(); const handleLogin = async () => { try { await authorize({customScheme: 'auth0sample', scope: 'openid profile email'}); } catch (e) { console.error('Login error:', e); } }; const handleLogout = async () => { try { await clearSession({customScheme: 'auth0sample'}); } catch (e) { console.error('Logout error:', e); } }; if (isLoading) { return ( Loading... ); } return ( Auth0 Expo Sample {user ? ( {user.picture && ( )} Welcome, {user.name}! {user.email}