Posts

Showing posts with the label Spring Boot JWT Authentication Example

Secure Your Spring Boot Backend and Angular Frontend with Okta

Image
Securing a Spring Boot backend and Angular frontend with Okta involves integrating authentication and authorization into both the backend and frontend using Okta's Identity Management platform. Here's a step-by-step guide: Backend (Spring Boot with Okta OAuth2 Integration) 1. Set Up Okta Developer Account Go to Okta Developer and create an account. Once logged in, create a new OAuth 2.0 Application in the Okta dashboard: Choose Web as the platform. Set up the Redirect URI to http://localhost:8080/login/oauth2/code/okta for local development. Set Grant Type to Authorization Code . After creating the app, note the Client ID , Client Secret , and Issuer URL (e.g., https://dev-XXXX.okta.com/oauth2/default ). 2. Add Dependencies to pom.xml Add the required dependencies for Spring Security OAuth2 and Okta to your pom.xml : <dependencies> <dependency> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-sta...

ReactJS, Spring Boot JWT Authentication Example

Image
In this tutorial, we’ll create a user registration & login example using ReactJS, Spring Boot, Spring Security, and JWT authentication. You could download the source code from our Github repository, the download link is provided at the end of this tutorial. Technologies used Backend Technologies: Java 17 Spring Boot 2.7.0 Spring Security Spring Data JPA JWT H2 Database Frontend Technologies: React 17.0.1 Axios 0.27.2 Redux 4.0.5 Bootstrap 4.5.2 ReactJS - SpringBoot - JWT - Flow Backend Project Directory: Frontend Project Directory: Following is the screenshot of our application - User Registration: User Signin: Profile View: Access Resource: We will build two projects:  1. Backend:   spring-boot-security-jwt 2. Frontend: react-redux-jwt Project 1: spring-boot-security-jwt Pom.xml <?xml version = "1.0" encoding = "UTF-8" ?> <project xmlns = "http://maven.apache.org/POM/4.0.0" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"...