Skip to content

Commit

Permalink
BAEL-4393: Module renamed to oauth-resource-server
Browse files Browse the repository at this point in the history
  • Loading branch information
sampadawagde committed Aug 11, 2020
1 parent 456b240 commit bbbb2a6
Showing 35 changed files with 131 additions and 136 deletions.
File renamed without changes.
125 changes: 125 additions & 0 deletions oauth-resource-server/authorization-server/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<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>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.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<addResources>true</addResources>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<configuration>
<nonFilteredFileExtensions>
<nonFilteredFileExtension>jks</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
<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>
2 changes: 1 addition & 1 deletion oauth-rs/pom.xml → oauth-resource-server/pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<description>JWT with OAuth2 Stack in Spring Security 5</description>

<groupId>com.baeldung</groupId>
<artifactId>oauth-rs</artifactId>
<artifactId>oauth-resource-server</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

File renamed without changes.
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@ public class JWTSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {// @formatter:off
http
.authorizeRequests(authorizeRequests -> authorizeRequests
.authorizeRequests(authz -> authz
.antMatchers(HttpMethod.GET, "/foos/**").hasAuthority("SCOPE_read")
.antMatchers(HttpMethod.POST, "/foos").hasAuthority("SCOPE_write")
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2ResourceServer -> oauth2ResourceServer.jwt());
.oauth2ResourceServer(oauth2 -> oauth2.jwt());
}// @formatter:on
}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -21,12 +21,12 @@ public class OpaqueSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {// @formatter:off
http
.authorizeRequests(authorizeRequests -> authorizeRequests
.authorizeRequests(authz -> authz
.antMatchers(HttpMethod.GET, "/bars/**").hasAuthority("SCOPE_read")
.antMatchers(HttpMethod.POST, "/bars").hasAuthority("SCOPE_write")
.anyRequest().authenticated())
.oauth2ResourceServer(oauth2ResourceServer -> oauth2ResourceServer
.opaqueToken(opaqueToken -> opaqueToken.introspectionUri(this.introspectionUri)
.oauth2ResourceServer(oauth2 -> oauth2
.opaqueToken(token -> token.introspectionUri(this.introspectionUri)
.introspectionClientCredentials(this.clientId, this.clientSecret)));// @formatter:on
}
}
130 changes: 0 additions & 130 deletions oauth-rs/authorization-server/pom.xml

This file was deleted.

0 comments on commit bbbb2a6

Please sign in to comment.