Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Spring Boot 3 and use the Okta Spring Boot Starter #21

Merged
merged 13 commits into from
Oct 26, 2023
Merged
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.1
parameters:
machine_image:
type: string
default: ubuntu-2004:202201-02
default: ubuntu-2204:2023.10.1
commands:
run-sample:
description: "Build and run the sample"
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
# Spring Boot 2 Login Samples

> **Note**
> If you are using Spring Boot 3, check out the [spring-boot-3 branch](https://github.com/auth0-samples/auth0-spring-boot-login-samples/tree/spring-boot-3), which contains an updated version of this sample for Spring Boot 3.

# Spring Boot Login Samples

[![CircleCI](https://circleci.com/gh/auth0-samples/auth0-spring-boot-login-samples.svg?style=svg)](https://circleci.com/gh/auth0-samples/auth0-spring-boot-login-samples)

Expand Down
2 changes: 1 addition & 1 deletion mvc-login/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:6.5-jdk8
FROM gradle:8.3-jdk17

WORKDIR /tmp
ADD . /tmp
Expand Down
8 changes: 6 additions & 2 deletions mvc-login/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Spring Boot 2 Login - MVC
# Spring Boot Login - MVC

This sample demonstrates:

- Adding authentication with Auth0 to a Spring Boot 2 MVC application
- Adding authentication with Auth0 using the [Okta Spring Boot Starter](https://github.com/okta/okta-spring-boot) to a Spring Boot MVC application
- Accessing profile information of the authenticated user
- Only allowing authenticated users to access certain resources

## Requirements

- Java 17

## Configuration

### Auth0 Dashboard
Expand Down
13 changes: 8 additions & 5 deletions mvc-login/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ buildscript {

plugins {
id 'java'
id 'org.springframework.boot' version '2.7.0'
id 'io.spring.dependency-management' version '1.1.0'
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
}

group = 'com.auth0'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '1.8'
jimmyjames marked this conversation as resolved.
Show resolved Hide resolved

java {
sourceCompatibility = '17'
}

repositories {
mavenCentral()
}

dependencies {
implementation 'com.okta.spring:okta-spring-boot-starter:3.0.5'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-oauth2-client'
implementation 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity5'
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
}
Binary file modified mvc-login/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion mvc-login/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading