-
-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-155 Configurable HTTP status in OAuth2 flows responses
- Loading branch information
Showing
15 changed files
with
452 additions
and
91 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
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
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
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
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
28 changes: 0 additions & 28 deletions
28
...ith-c4-soft/bff-c4/src/main/java/com/c4_soft/dzone_oauth2_spring/c4_bff/SecurityConf.java
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,35 +1,7 @@ | ||
package com.c4_soft.dzone_oauth2_spring.c4_bff; | ||
|
||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.security.core.Authentication; | ||
import org.springframework.security.oauth2.client.registration.ReactiveClientRegistrationRepository; | ||
import org.springframework.security.web.server.WebFilterExchange; | ||
import org.springframework.security.web.server.authentication.logout.ServerLogoutSuccessHandler; | ||
import org.springframework.stereotype.Component; | ||
|
||
import com.c4_soft.springaddons.security.oidc.starter.LogoutRequestUriBuilder; | ||
import com.c4_soft.springaddons.security.oidc.starter.reactive.client.SpringAddonsServerLogoutSuccessHandler; | ||
|
||
import reactor.core.publisher.Mono; | ||
|
||
@Configuration | ||
public class SecurityConf { | ||
|
||
@Component | ||
static class AngularLogoutSucessHandler implements ServerLogoutSuccessHandler { | ||
private final SpringAddonsServerLogoutSuccessHandler delegate; | ||
|
||
public AngularLogoutSucessHandler(LogoutRequestUriBuilder logoutUriBuilder, ReactiveClientRegistrationRepository clientRegistrationRepo) { | ||
this.delegate = new SpringAddonsServerLogoutSuccessHandler(logoutUriBuilder, clientRegistrationRepo); | ||
} | ||
|
||
@Override | ||
public Mono<Void> onLogoutSuccess(WebFilterExchange exchange, Authentication authentication) { | ||
return delegate.onLogoutSuccess(exchange, authentication).then(Mono.fromRunnable(() -> { | ||
exchange.getExchange().getResponse().setStatusCode(HttpStatus.ACCEPTED); | ||
})); | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.