Skip to content

jhordeym-santos/auth0-spring-poc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth0 Spring POC

Installing Auth0 CLI and app creation

# Installing auth0 cli
brew tap auth0/auth0-cli && brew install auth0

# auth0 version 1.28.0 ...
auth0 --version

# auth0 login
# will return [AUTH0_TENANT]
auth0 login
#  How would you like to authenticate? As a user

# ▸    Successfully logged in.
# ▸    Tenant: [AUTH0_TENANT]

# create app in auth0
# This will return your [CLIENT_ID], [CLIENT_SECRET] and other information
auth0 apps create \
  --name "Spring Boot" \
  --description "Spring Boot Example" \
  --type regular \
  --callbacks http://localhost:8080/login/oauth2/code/okta \
  --logout-urls http://localhost:8080 \
  --reveal-secrets

Auth0 Test Login

# auth0 test login
auth0 test login [CLIENT_ID]

# If successfully authenticated should return:
{
  user_info: { ... },
  tokens: {
    "access_token": "ey...",
    "id_token": "ey...",
    "token_type": "Bearer",
    "expires_in": [long]
  }
}

Auth0 configuration

export OKTA_ISSUER=https://[AUTH0_TENANT].auth0.com/
export OKTA_CLIENT_ID=[AUTH0_CLIENT_ID]
export OKTA_CLIENT_SECRET=[AUTH0_CLIENT_SECRET]

Build and running the Spring app with Gradle

./gradlew build

./gradlew bootRun

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors