• Stars
    star
    252
  • Rank 161,312 (Top 4 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 6 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple CRUD with React and Spring Boot 3

JUG Tours with Spring Boot and React

This example app shows how to create a Spring Boot API and CRUD (create, read, update, and delete) its data with a React app.

Please read Use React and Spring Boot to Build a Simple CRUD App to see how this app was created.

Prerequisites: Java 17 and Node.js 18+

Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage, and secure users and roles in any application.

Getting Started

To install this example application, run the following commands:

git clone https://github.com/oktadev/okta-spring-boot-react-crud-example.git spring-react
cd spring-react

This will get a copy of the project installed locally.

Create an Application in Okta

Before you begin, you'll need a free Okta developer account. Install the Okta CLI and run okta register to sign up for a new account. If you already have an account, run okta login.

Then, run okta apps create. Select the default app name, or change it as you see fit. Choose Web and press Enter.

Select Okta Spring Boot Starter. Accept the default Redirect URI of http://localhost:8080/login/oauth2/code/okta and use http://localhost:3000,http://localhost:8080 for the Logout Redirect URI.

The Okta CLI will create an OIDC Web App in your Okta Org. It will add the redirect URIs you specified and grant access to the Everyone group. You will see output like the following when it's finished:

Okta application configuration has been written to:
  /path/to/app/src/main/resources/application.properties

Open src/main/resources/application.properties to see the issuer and credentials for your app.

okta.oauth2.issuer=https://dev-133337.okta.com/oauth2/default
okta.oauth2.client-id=0oab8eb55Kb9jdMIr5d6
okta.oauth2.client-secret=NEVER-SHOW-SECRETS

NOTE: You can also use the Okta Admin Console to create your app. See Create a Spring Boot App for more information.

Run ./mvnw spring-boot:run -Pprod and log in to your app at http://localhost:8080.

Use Auth0 for OpenID Connect

If you'd rather use Auth0, that's possible too! First, you'll need to checkout the auth0 branch of this repository.

git clone -b auth0 https://github.com/oktadev/okta-spring-boot-react-crud-example.git spring-react
cd spring-react

Then, install the Auth0 CLI and run auth0 login in a terminal.

Next, run auth0 apps create and specify the appropriate URLs:

auth0 apps create \
  --name "Spring Boot + React" \
  --description "Spring Boot OIDC App" \
  --type regular \
  --callbacks http://localhost:8080/login/oauth2/code/okta \
  --logout-urls http://localhost:3000,http://localhost:8080 \
  --reveal-secrets

Modify your src/main/resources/application.properties to include your Auth0 issuer, client ID, and client secret.

# make sure to include the trailing slash for the Auth0 issuer
okta.oauth2.issuer=https://<your-auth0-domain>/
okta.oauth2.issuer.client-id=<your-client-id>
okta.oauth2.issuer.client-secret=<your-client-secret>

NOTE: You can also use your Auth0 dashboard to configure your application. Just make sure to use the same URLs specified above.

Run ./mvnw spring-boot:run -Pprod and log in to your app at http://localhost:8080.

Links

This example uses the following open source libraries:

Help

Please post any questions as comments on the blog post, or visit our Okta Developer Forums.

License

Apache 2.0, see LICENSE.

More Repositories

1

java-microservices-examples

Java Microservices: Spring Boot, Spring Cloud, JHipster, Spring Cloud Config, and Spring Cloud Gateway
Java
498
star
2

okta-aws-cli-assume-role

Okta AWS CLI Assume Role Tool
HTML
337
star
3

spring-boot-microservices-example

Bootiful Microservices with Spring Boot
TypeScript
307
star
4

okta-spring-boot-2-angular-5-example

A Cool Cars Example that showcases Spring Boot 2, Angular 5, and Okta's Support for both.
TypeScript
131
star
5

jhipster-microservices-example

JHipster Microservices Example using Spring Cloud, Spring Boot, Angular, Docker, and Kubernetes
Java
126
star
6

spring-boot-react-example

Example app showing how to build a Spring Boot REST API and React UI
TypeScript
109
star
7

spring-boot-angular-example

Example app showing how to build a Spring Boot REST API and Angular UI
TypeScript
94
star
8

okta-vue-node-example

Example of a Basic CRUD App with Vue.js and Node
JavaScript
90
star
9

okta-spring-boot-2-angular-7-example

A Cool Cars Example that showcases Spring Boot 2.1, Angular 7, and Okta's support for both.
TypeScript
86
star
10

schematics

Schematics for adding Okta and Auth0 Auth to your projects
TypeScript
69
star
11

okta-node-express-typescript-vue-example

Example Node.js API using TypeScript, Express, and Vue
TypeScript
66
star
12

native-java-examples

Native Java Apps with Micronaut, Quarkus, and Spring Boot
HTML
61
star
13

okta-react-node-example

A simple React.js + Node.js example app.
JavaScript
58
star
14

okta-spring-boot-authz-server-example

Spring Security OAuth 2.0 Guide
Java
58
star
15

okta-spring-boot-saml-example

Spring Boot, SAML, and Okta
Java
57
star
16

okta-oidc-flows-example

JavaScript
56
star
17

okta-spring-boot-2-angular-8-example

Angular 8 + Spring Boot 2.2 = ❀️
TypeScript
53
star
18

python-flask-react-crud-example

Build a simple CRUD application with Python, Flask, and React.
JavaScript
51
star
19

okta-php-core-rest-api-example

PHP
49
star
20

okta-go-vue-example

An Okta example app built with Go + Vue.
Go
47
star
21

okta-nodejs-sql-server-example

JavaScript
47
star
22

okta-scim-beta

Python
44
star
23

okta-kong-origin-example

Kong Gateway Example with OIDC and Okta
Java
44
star
24

okta-spring-boot-vue-crud-example

A Todo App that showcases Spring Boot, Vue.js, and Okta's support for both.
Vue
42
star
25

okta-blog

The Okta developer blog.
SCSS
41
star
26

okta-spring-boot-2-angular-9-example

CRUD Example with Angular 9.0 and Spring Boot 2.2
TypeScript
40
star
27

okta-dac

Okta Delegated Admin Console
Vue
38
star
28

okta-aspnetcore-vue-crud-example

CRUD Application with ASP.NET Core and Vue.js
JavaScript
37
star
29

okta-php-symfony-vue-crud-example

Build a Basic CRUD App with Symfony 4 and Vue
PHP
31
star
30

okta-node-sql-server-example

Build a Node.js App with SQL Server Tutorial
JavaScript
30
star
31

okta-jhipster-microservices-oauth-example

A microservices architecture built with JHipster, OAuth 2.0, and Okta
Java
30
star
32

okta-react-native-app-auth-example

React Native Example that Authenticates with Okta using App Auth
JavaScript
29
star
33

auth0-java-microservices-examples

Java Microservice Examples
Java
29
star
34

okta-wordpress-sign-in-widget

Replaces the WordPress login screen with the Okta sign-in widget
PHP
29
star
35

okta-vue-auth-example

A Vue.js Example with Okta for Authentication
JavaScript
29
star
36

okta-aspnet-mvc-example

ASP.NET 4.x MVC + Okta example
JavaScript
28
star
37

spring-boot-ionic-example

Example app that shows how to develop a mobile app with Ionic, Angular, and Spring Boot
TypeScript
28
star
38

auth0-full-stack-java-example

πŸ”₯ Full Stack Java Example
Java
28
star
39

auth0-java-oauth-examples

Java
27
star
40

okta-react-native-spring-boot-example

React Native + Spring Boot + OIDC
Java
27
star
41

auth0-spring-boot-angular-crud-example

Angular and Spring Boot CRUD Example
Java
27
star
42

ionic-jhipster-starter

Starter Template for Ionic Apps with JHipster
TypeScript
27
star
43

spring-boot-angular-pwa-example

Spring Boot API with Angular PWA
TypeScript
24
star
44

okta-angular-microfrontend-example

Starter code + completed project for micro-frontends using Webpack 5 and Module Federation plugin in Angular and sharing authenticated state
TypeScript
24
star
45

byob-dashboard

Vue
24
star
46

auth0-micro-frontends-jhipster-example

Micro Frontends for Java Microservices
Java
24
star
47

okta-ionic-auth-example

Example showing Ionic Authentication with Okta
TypeScript
23
star
48

spring-boot-vue-example

Bootiful Spring Boot + Vue Example
Vue
23
star
49

okta-cli-mfa-example

Shell
23
star
50

shiro-spring-boot-example

Java
23
star
51

auth0-java-rest-api-examples

Java REST API Examples
HTML
23
star
52

okta-aspnetcore-mvc-example

ASP.NET Core 2.0 MVC + Okta example
C#
22
star
53

okta-php-laravel-vue-crud-example

PHP
22
star
54

okta-angular-openid-connect-example

Angular + Angular CLI with Authentication from OpenID Connect and Okta
TypeScript
22
star
55

okta-react-photo-gallery-example

A Photo Gallery Example with React, Spring Boot, and JHipster 5 + Auth by Okta
TypeScript
22
star
56

crypto-invoicer

A personal web portal for invoicing clients with Bitcoin.
JavaScript
21
star
57

gatsby-netlify-okta-example

Gatsby, Netlify, and Okta Example App
JavaScript
21
star
58

okta-spring-boot-oauth-example

Spring Boot, OAuth 2.0, and Okta Example
Groovy
21
star
59

okta-smartfhir-docs

Documentation for using Okta as a SMART/FHIR authorization server.
20
star
60

api-security-book

CSS
20
star
61

okta-angular-material-login-example

Angular Material Login Example
TypeScript
20
star
62

okta-graphql-react-express-example

Web App with Express, React and GraphQL
JavaScript
20
star
63

okta-microservice-security-examples

Demos from Oktane18: API and Microservices Best Practices
Java
18
star
64

okta-spring-security-5-example

Authentication with Spring Security 5 and Okta OIDC
Java
18
star
65

okta-angular-sign-in-widget-example

Angular + Okta Sign-In Widget Example
TypeScript
18
star
66

okta-node-express-example

A simple sample application built using Node and Express that contains user login, registration, and password reset functionality.
JavaScript
17
star
67

okta-smartfhir-demo

Example of using Okta as an authorization server as part of a SMART on FHIR deployment.
JavaScript
16
star
68

okta-express-graphql-example

JavaScript
16
star
69

okta-spring-boot-oidc-sso-example

JavaScript
15
star
70

okta-openidconnect-appauth-android

Android Application with Okta as the IdP and AppAuth as the OpenID Connect mobile library
Java
14
star
71

example-maven-plugin

A simple example Apache Maven plugin
Java
14
star
72

okta-dotnetcore-react-example

C#
14
star
73

okta-node-express-typescript-react-example

Node.js API with TypeScript
TypeScript
14
star
74

okta-node-rest-api-example

Simple REST API with Node and OAuth 2.0
JavaScript
14
star
75

okta-angular-spring-boot-docker-example

Angular + Spring Boot Docker Example
TypeScript
14
star
76

okta-socket-io-chat-example

A simple chat application based on Socket.IO, React, and Express.
JavaScript
14
star
77

okta-spring-security-roles-example

Okta + Groups with Spring Security
Java
14
star
78

okta-ionic-4-login-example

Ionic 4 User Login and Registration Example
TypeScript
13
star
79

okta-nestjs-postgres-example

Sample application using NestJS and Postgres
TypeScript
13
star
80

okta-angular-node-example

Basic CRUD Example with Angular and Node
TypeScript
13
star
81

terraform-provider-oktaasa

Terraform Okta ASA provider
Go
13
star
82

okta-android-kotlin-crud-example

The source code for the Okta Kotlin Android CRUD tutorial.
Kotlin
13
star
83

okta-angular-mysql-timeline-example

An Angular + MySQL Timeline Example
TypeScript
13
star
84

okta-kotlin-typescript-notes-example

Kotlin and TypeScript! πŸŽ‰
TypeScript
13
star
85

auth0-spring-boot-passkeys-demo

A passkeys demo using Spring Boot and Auth0 as IdP
Java
13
star
86

okta-openidconnect-appauth-ios

iOS Sample Application with AppAuth
Swift
12
star
87

okta-angular-electron-example

TypeScript
12
star
88

spring-boot-client-credentials-example

Shell
12
star
89

okta-spring-jx-example

CI/CD for Spring Boot with Jenkins X and Kubernetes
Java
12
star
90

okta-react-docker-example

React + Docker Example
JavaScript
12
star
91

okta-oauth2-proxy-example

Java
12
star
92

okta-spring-jwt-and-opaque-token-example

Java
12
star
93

okta-spring-boot-angular-auth-code-flow-example

Package Angular and Spring Boot into a single JAR!
Java
12
star
94

okta-vanilla-js-example

A Vanilla JavaScript App with Authentication
JavaScript
12
star
95

rockstar

rockstar Chrome extension - enhance Okta
JavaScript
11
star
96

okta-php-symfony-angular-crud-example

Example CRUD App with Symfony and Angular
PHP
11
star
97

okta-appauth-xamarin-example

Xamarin.Forms authentication with OpenID Connect and Okta
C#
10
star
98

okta-node-cli-example

A command-line applications using Node.js
JavaScript
10
star
99

okta-node-express-15-minute-auth-example

Secure Authentication with Express and Okta
Handlebars
10
star
100

okta-php-trivia-react

PHP
10
star