Skip to content

A sample of Auth0 security used in a SpringBoot & React/TS application

Notifications You must be signed in to change notification settings

errixed/auth0-springboot-security

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

My Skills

auth0-springboot-security

A sample code that shows how to secure springboot-backend and react/typescript-frontend application using auth0. this is a simplified code from @auth0-developer-hub

GitHub followers GitHub forks GitHub watchers GitHub Repo stars

Built with

PostgreSQL: latest
JDK: oracle openJDK v19.0.2
Spring Boot: v2.7.12
React: Typescript
Auth0

Setup June 2023

Auth0 setups

  1. Create an Application

    To create an application, open the Applications section of Dashboard and click on the Create Application

    • Name: Hello World Client

    You can use any name

    • Application Type: Single Page Web Applications
  2. Fill out Application URIs

    Click on Settings tab of your Application page, and scroll until you see Application URIs

    • Allowed Callback URLs: http://localhost:4040/callback
    • Allowed Logout URLs: http://localhost:4040
    • Allowed Web Origins: http://localhost:4040
  3. click the Save Changes
  4. Create API

    To create API, open the APIs section of Dashboard and Click on the Create API

    • Name: Name: Hello World Server

      you can use any name

    • Identifier: https://hello-world.example.com

      you can use any logical identifier

Spring setups

  1. edit .env file
    • AUTH0-DOMAIN: go to Applications > Applications > your application > Domain
    • AUTH0-AUDIENCE: go to Applications > APIs > your server > Identifier
  2. edit application.properties

    set Name of Database and Postgres password

React setups

  1. install node.js on your local machine
  2. In the frontend directory, run this code on terminal to install package.json:
npm install
npm start
  1. edit .env file
    • AUTH0-DOMAIN: go to Applications > Applications > your application > Domain
    • AUTH0-CLIENT-ID: go to Applications > Applications > your application > Client ID
    • AUTH0-AUDIENCE: go to Applications > APIs > your server > Identifier

Sources

more info: auth0 developers documantation

About

A sample of Auth0 security used in a SpringBoot & React/TS application

Topics

Resources

Stars

Watchers

Forks