forked from Baeldung/spring-security-oauth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Baeldung#203 from sampada07/JAVA-409
JAVA-409: Update SSO with OAuth2 article
- Loading branch information
Showing
26 changed files
with
645 additions
and
621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,21 @@ | |
### Relevant information: | ||
|
||
1. `sso-authorization-server` is a Keycloak Authorization Server wrapped as a Spring Boot application | ||
2. There is one OAuth Client registered in the Authorization Server: | ||
1. Client Id: ssoClient | ||
2. Client secret: ssoClientSecret | ||
3. Redirect Uri: http://localhost:8089/ | ||
2. There are two OIDC-Connect Clients registered in the Authorization Server: | ||
First - | ||
1. Client Id: ssoClient-1 | ||
2. Client secret: ssoClientSecret-1 | ||
3. Redirect Uri: http://localhost:8082/ui-one/login/oauth2/code/custom | ||
And second - | ||
1. Client Id: ssoClient-2 | ||
2. Client secret: ssoClientSecret-2 | ||
3. Redirect Uri: http://localhost:8084/ui-two/login/oauth2/code/custom | ||
3. `sso-resource-server` is a Spring Boot based RESTFul API, acting as a backend Application | ||
4. `sso-client-app-1` and `sso-client-app-2` are two identical Spring MVC Thymeleaf App acting our front end. They are available at [http://localhost:8082/ui-one/](http://localhost:8082/ui-one) and [http://localhost:8084/ui-two/](http://localhost:8084/ui-two/) respectively. | ||
5. There are two users registered in the Authorization Server: | ||
1. [email protected] / 123 | ||
2. [email protected] / pass | ||
6. The module uses the new OAuth stack with Java 13. | ||
|
||
## Relevant Articles: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<description>New OAuth2 Stack in Spring Security 5</description> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<description>New OAuth2 Stack in Spring Security 5</description> | ||
|
||
<groupId>com.baeldung</groupId> | ||
<artifactId>oauth-sso</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
<groupId>com.baeldung</groupId> | ||
<artifactId>oauth-sso</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<packaging>pom</packaging> | ||
|
||
<modules> | ||
<module>sso-authorization-server</module> | ||
<module>sso-resource-server</module> | ||
<module>sso-client-app-1</module> | ||
<module>sso-client-app-2</module> | ||
</modules> | ||
<modules> | ||
<module>sso-authorization-server</module> | ||
<module>sso-resource-server</module> | ||
<module>sso-client-app-1</module> | ||
<module>sso-client-app-2</module> | ||
</modules> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,114 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.baeldung</groupId> | ||
<artifactId>sso-authorization-server</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.2.6.RELEASE</version> | ||
<relativePath /> | ||
</parent> | ||
|
||
<dependencies> | ||
|
||
<!-- web --> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
|
||
<!-- persistence --> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<!-- Keycloak server --> | ||
|
||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-jackson2-provider</artifactId> | ||
<version>${resteasy.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.keycloak</groupId> | ||
<artifactId>keycloak-dependencies-server-all</artifactId> | ||
<version>${keycloak.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
<!-- config properties processor --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<!-- test --> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>**/*LiveTest.java</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<developers> | ||
<developer> | ||
<email>[email protected]</email> | ||
<name>Eugen Paraschiv</name> | ||
<url>https://github.com/eugenp</url> | ||
<id>eugenp</id> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<!-- non-dependencies --> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<java.version>13</java.version> | ||
|
||
<keycloak.version>10.0.1</keycloak.version> | ||
<resteasy.version>3.11.2.Final</resteasy.version> | ||
</properties> | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.baeldung</groupId> | ||
<artifactId>sso-authorization-server</artifactId> | ||
<version>0.1.0-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.2.6.RELEASE</version> | ||
<relativePath /> | ||
</parent> | ||
|
||
<dependencies> | ||
|
||
<!-- web --> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-web</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-actuator</artifactId> | ||
</dependency> | ||
|
||
<!-- persistence --> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-data-jpa</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.h2database</groupId> | ||
<artifactId>h2</artifactId> | ||
<scope>runtime</scope> | ||
</dependency> | ||
|
||
<!-- Keycloak server --> | ||
|
||
<dependency> | ||
<groupId>org.jboss.resteasy</groupId> | ||
<artifactId>resteasy-jackson2-provider</artifactId> | ||
<version>${resteasy.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.keycloak</groupId> | ||
<artifactId>keycloak-dependencies-server-all</artifactId> | ||
<version>${keycloak.version}</version> | ||
<type>pom</type> | ||
</dependency> | ||
|
||
<!-- config properties processor --> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-configuration-processor</artifactId> | ||
<optional>true</optional> | ||
</dependency> | ||
|
||
<!-- test --> | ||
|
||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>io.rest-assured</groupId> | ||
<artifactId>rest-assured</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<excludes> | ||
<exclude>**/*LiveTest.java</exclude> | ||
</excludes> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<developers> | ||
<developer> | ||
<email>[email protected]</email> | ||
<name>Eugen Paraschiv</name> | ||
<url>https://github.com/eugenp</url> | ||
<id>eugenp</id> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<!-- non-dependencies --> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<java.version>13</java.version> | ||
|
||
<keycloak.version>10.0.1</keycloak.version> | ||
<resteasy.version>3.11.2.Final</resteasy.version> | ||
</properties> | ||
|
||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.