Skip to content

Commit

Permalink
Refactor: Change login, logout redirect uri
Browse files Browse the repository at this point in the history
  • Loading branch information
huGgW committed Sep 1, 2023
1 parent 4511a85 commit 35d0fa1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class SecurityConfig(
.cors().and()
.csrf().disable()
.oauth2Login()
.loginPage("/oauth2/authorization/idsnucse")
.loginPage("/api/v1/login/oauth2/authorization/idsnucse")
.userInfoEndpoint().oidcUserService(customOidcUserService).and()
.successHandler(CustomAuthenticationSuccessHandler(endpointProperties.frontend)).and()
.logout()
Expand All @@ -41,7 +41,7 @@ class SecurityConfig(
.clearAuthentication(true)
.deleteCookies("JSESSIONID").and()
.authorizeHttpRequests()
.requestMatchers("/login").authenticated()
.requestMatchers("/api/v1/login").permitAll()
.anyRequest().permitAll().and()
.build()
}
Expand All @@ -54,7 +54,7 @@ class SecurityConfig(
response: HttpServletResponse?,
authentication: Authentication?
) {
val redirectUrl = "${endpointProperties.frontend}/logout/success"
val redirectUrl = "${endpointProperties.frontend}/api/v1/logout/success"
super.setDefaultTargetUrl(redirectUrl)
super.onLogoutSuccess(request, response, authentication)
}
Expand Down
14 changes: 9 additions & 5 deletions src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,25 @@ spring:
client:
registration:
idsnucse:
redirect-uri: http://localhost:8080/login/oauth2/code/idsnucse
redirect-uri: http://localhost:8080/api/v1/login/oauth2/code/idsnucse

logging.level:
default: INFO
org:
springframework:
security: DEBUG

csereal_image:
csereal:
upload:
path: /app/image/
path: ./attachment/

csereal_attachment:
upload:
path: /app/attachment/
path: ./attachment/

csereal_image:
upload:
path: ./attachment/

endpoint:
backend: http://localhost:8080
Expand All @@ -85,7 +89,7 @@ spring:
client:
registration:
idsnucse:
redirect-uri: http://${URL}/login/oauth2/code/idsnucse
redirect-uri: http://${URL}/api/v1/login/oauth2/code/idsnucse

csereal_image:
upload:
Expand Down

0 comments on commit 35d0fa1

Please sign in to comment.