-
-
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.
Fix post login/logout headers & params detection in reactive apps
- Loading branch information
Showing
3 changed files
with
123 additions
and
195 deletions.
There are no files selected for viewing
48 changes: 10 additions & 38 deletions
48
.../oidc/starter/properties/condition/bean/DefaultAuthenticationFailureHandlerCondition.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,50 +1,22 @@ | ||
package com.c4_soft.springaddons.security.oidc.starter.properties.condition.bean; | ||
|
||
import org.springframework.boot.autoconfigure.condition.AllNestedConditions; | ||
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions; | ||
import org.springframework.context.annotation.Conditional; | ||
import org.springframework.security.web.authentication.AuthenticationFailureHandler; | ||
import org.springframework.security.web.server.authentication.ServerAuthenticationFailureHandler; | ||
|
||
public class DefaultAuthenticationFailureHandlerCondition extends AllNestedConditions { | ||
public class DefaultAuthenticationFailureHandlerCondition extends NoneNestedConditions { | ||
|
||
public DefaultAuthenticationFailureHandlerCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
public DefaultAuthenticationFailureHandlerCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
|
||
@Conditional(NoAuthenticationFailureHandlerCondition.class) | ||
static class AuthenticationFailureHandlerMissingCondition {} | ||
@ConditionalOnBean(AuthenticationFailureHandler.class) | ||
static class AuthenticationFailureHandlerProvidedCondition { | ||
} | ||
|
||
@Conditional(PostLoginRedirectUriCondition.class) | ||
static class PostLoginRedirectUriProvidedCondition {} | ||
|
||
static class NoAuthenticationFailureHandlerCondition extends NoneNestedConditions { | ||
|
||
public NoAuthenticationFailureHandlerCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
|
||
@ConditionalOnBean(AuthenticationFailureHandler.class) | ||
static class AuthenticationFailureHandlerProvidedCondition {} | ||
|
||
@ConditionalOnBean(ServerAuthenticationFailureHandler.class) | ||
static class ServerAuthenticationFailureHandlerProvidedCondition {} | ||
} | ||
|
||
static class PostLoginRedirectUriCondition extends AnyNestedCondition { | ||
|
||
public PostLoginRedirectUriCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
|
||
@ConditionalOnProperty(name = "com.c4-soft.springaddons.oidc.client.post-login-redirect-host") | ||
static class PostLoginRedirectHostCondition {} | ||
|
||
@ConditionalOnProperty(name = "com.c4-soft.springaddons.oidc.client.post-login-redirect-path") | ||
static class PostLoginRedirectPathCondition {} | ||
} | ||
@ConditionalOnBean(ServerAuthenticationFailureHandler.class) | ||
static class ServerAuthenticationFailureHandlerProvidedCondition { | ||
} | ||
|
||
} |
48 changes: 10 additions & 38 deletions
48
.../oidc/starter/properties/condition/bean/DefaultAuthenticationSuccessHandlerCondition.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,49 +1,21 @@ | ||
package com.c4_soft.springaddons.security.oidc.starter.properties.condition.bean; | ||
|
||
import org.springframework.boot.autoconfigure.condition.AllNestedConditions; | ||
import org.springframework.boot.autoconfigure.condition.AnyNestedCondition; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions; | ||
import org.springframework.context.annotation.Conditional; | ||
import org.springframework.security.web.authentication.AuthenticationSuccessHandler; | ||
import org.springframework.security.web.server.authentication.ServerAuthenticationSuccessHandler; | ||
|
||
public class DefaultAuthenticationSuccessHandlerCondition extends AllNestedConditions { | ||
public class DefaultAuthenticationSuccessHandlerCondition extends NoneNestedConditions { | ||
|
||
public DefaultAuthenticationSuccessHandlerCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
public DefaultAuthenticationSuccessHandlerCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
|
||
@Conditional(NoAuthenticationSuccessHandlerCondition.class) | ||
static class AuthenticationSuccessHandlerMissingCondition {} | ||
@ConditionalOnBean(AuthenticationSuccessHandler.class) | ||
static class AuthenticationSuccessHandlerProvidedCondition { | ||
} | ||
|
||
@Conditional(PostLoginRedirectUriCondition.class) | ||
static class PostLoginRedirectUriProvidedCondition {} | ||
|
||
static class NoAuthenticationSuccessHandlerCondition extends NoneNestedConditions { | ||
|
||
public NoAuthenticationSuccessHandlerCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
|
||
@ConditionalOnBean(AuthenticationSuccessHandler.class) | ||
static class AuthenticationSuccessHandlerProvidedCondition {} | ||
|
||
@ConditionalOnBean(ServerAuthenticationSuccessHandler.class) | ||
static class ServerAuthenticationSuccessHandlerProvidedCondition {} | ||
} | ||
|
||
static class PostLoginRedirectUriCondition extends AnyNestedCondition { | ||
|
||
public PostLoginRedirectUriCondition() { | ||
super(ConfigurationPhase.REGISTER_BEAN); | ||
} | ||
|
||
@ConditionalOnProperty(name = "com.c4-soft.springaddons.oidc.client.post-login-redirect-host") | ||
static class PostLoginRedirectHostCondition {} | ||
|
||
@ConditionalOnProperty(name = "com.c4-soft.springaddons.oidc.client.post-login-redirect-path") | ||
static class PostLoginRedirectPathCondition {} | ||
} | ||
@ConditionalOnBean(ServerAuthenticationSuccessHandler.class) | ||
static class ServerAuthenticationSuccessHandlerProvidedCondition { | ||
} | ||
} |
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