Skip to content

Commit 4bd88ef

Browse files
authored
Merge pull request #17 from Nasruddin/feature/authorization-server-impl
cleaning oauth flow
2 parents 93ed233 + 11bb5e7 commit 4bd88ef

File tree

10 files changed

+10
-8
lines changed

10 files changed

+10
-8
lines changed

config-repo/course-composite.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ springdoc:
99
cache:
1010
disabled: true
1111
swagger-ui:
12-
oauth2-redirect-url: https://localhost:8443/webjars/swagger-ui/oauth2-redirect.html
12+
oauth2-redirect-url: http://localhost:8443/webjars/swagger-ui/oauth2-redirect.html
1313
oauth:
1414
clientId: writer
1515
clientSecret: secret
1616
useBasicAuthenticationWithAccessCodeGrant: true
1717
oAuthFlow:
18-
authorizationUrl: https://localhost:8443/oauth2/authorize
19-
tokenUrl: https://localhost:8443/oauth2/token
18+
authorizationUrl: http://localhost:8443/oauth2/authorize
19+
tokenUrl: http://localhost:8443/oauth2/token
2020

2121
server.forward-headers-strategy: framework
2222

images/build.png

190 KB
Loading

images/docker-compose.png

101 KB
Loading

images/docker-ps.png

258 KB
Loading

images/eureka.png

498 KB
Loading

images/gateway-routes.png

196 KB
Loading

images/jwt-io.png

201 KB
Loading

images/oauth-endpoint.png

212 KB
Loading

microservices/course-composite-service/src/main/java/io/javatab/microservices/composite/course/configuration/SecurityConfig.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package io.javatab.microservices.composite.course.configuration;
22

33
import org.springframework.context.annotation.Bean;
4+
import org.springframework.context.annotation.Configuration;
45
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
56
import org.springframework.security.config.web.server.ServerHttpSecurity;
67
import org.springframework.security.web.server.SecurityWebFilterChain;
78

89
import static org.springframework.http.HttpMethod.*;
910

11+
@Configuration
1012
@EnableWebFluxSecurity
1113
public class SecurityConfig {
1214

spring-cloud/authorization-server/src/main/java/io/javatab/springcloud/auth/configuration/AuthorizationServerConfig.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ public RegisteredClientRepository registeredClientRepository() {
115115
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
116116
.authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN)
117117
.authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS)
118-
.redirectUri("https://my.redirect.uri")
119-
.redirectUri("https://localhost:8443/openapi/webjars/swagger-ui/oauth2-redirect.html")
118+
.redirectUri("http://my.redirect.uri")
119+
.redirectUri("http://localhost:8443/openapi/webjars/swagger-ui/oauth2-redirect.html")
120120
.scope(OidcScopes.OPENID)
121121
.scope("course:read")
122122
.scope("course:write")
@@ -131,8 +131,8 @@ public RegisteredClientRepository registeredClientRepository() {
131131
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
132132
.authorizationGrantType(AuthorizationGrantType.REFRESH_TOKEN)
133133
.authorizationGrantType(AuthorizationGrantType.CLIENT_CREDENTIALS)
134-
.redirectUri("https://my.redirect.uri")
135-
.redirectUri("https://localhost:8443/openapi/webjars/swagger-ui/oauth2-redirect.html")
134+
.redirectUri("http://my.redirect.uri")
135+
.redirectUri("http://localhost:8443/openapi/webjars/swagger-ui/oauth2-redirect.html")
136136
.scope(OidcScopes.OPENID)
137137
.scope("course:read")
138138
.clientSettings(ClientSettings.builder().requireAuthorizationConsent(true).build())
@@ -157,7 +157,7 @@ public JwtDecoder jwtDecoder(JWKSource<SecurityContext> jwkSource) {
157157

158158
@Bean
159159
public AuthorizationServerSettings authorizationServerSettings() {
160-
return AuthorizationServerSettings.builder().issuer("http://auth-server").build();
160+
return AuthorizationServerSettings.builder().issuer("http://auth-server:9999").build();
161161
}
162162

163163
private Consumer<List<AuthenticationProvider>> configureAuthenticationValidator() {

0 commit comments

Comments
 (0)