Package swiss.trustbroker.oidc
Class CustomOAuth2AuthorizationService
java.lang.Object
org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
swiss.trustbroker.oidc.CustomOAuth2AuthorizationService
- All Implemented Interfaces:
org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
public class CustomOAuth2AuthorizationService
extends org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.JsonMapperOAuth2AuthorizationParametersMapper, org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.JsonMapperOAuth2AuthorizationRowMapper, org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.OAuth2AuthorizationParametersMapper, org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService.OAuth2AuthorizationRowMapper -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCustomOAuth2AuthorizationService(org.springframework.jdbc.core.JdbcOperations jdbcOperations, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository, TrustBrokerProperties trustBrokerProperties, GlobalExceptionHandler globalExceptionHandler, Clock clock, MetricsService metricsService) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyPenTestScenarioForBackend(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization) void@Nullable org.springframework.security.oauth2.server.authorization.OAuth2Authorization@Nullable org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationfindByToken(String token, @Nullable org.springframework.security.oauth2.server.authorization.OAuth2TokenType tokenType) getSubjectTokenCount(String subjectToken) voidsave(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization) org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationsavePenTestScenarioForBackend(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization) voidsaveTokenExchangeSubjectToken(String subjectToken, String clientId, String principalName, Timestamp iat, Timestamp expiration) Methods inherited from class org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
getAuthorizationParametersMapper, getAuthorizationRowMapper, getJdbcOperations, getLobHandler, remove, setAuthorizationParametersMapper, setAuthorizationRowMapper
-
Field Details
-
metricsService
-
-
Constructor Details
-
CustomOAuth2AuthorizationService
public CustomOAuth2AuthorizationService(org.springframework.jdbc.core.JdbcOperations jdbcOperations, org.springframework.security.oauth2.server.authorization.client.RegisteredClientRepository registeredClientRepository, TrustBrokerProperties trustBrokerProperties, GlobalExceptionHandler globalExceptionHandler, Clock clock, MetricsService metricsService)
-
-
Method Details
-
findById
public @Nullable org.springframework.security.oauth2.server.authorization.OAuth2Authorization findById(String id) - Specified by:
findByIdin interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService- Overrides:
findByIdin classorg.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
-
findByToken
public @Nullable org.springframework.security.oauth2.server.authorization.OAuth2Authorization findByToken(String token, @Nullable org.springframework.security.oauth2.server.authorization.OAuth2TokenType tokenType) - Specified by:
findByTokenin interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService- Overrides:
findByTokenin classorg.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
-
save
public void save(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization) - Specified by:
savein interfaceorg.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService- Overrides:
savein classorg.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
-
saveTokenExchangeSubjectToken
-
getSubjectTokenCount
-
deleteExpiredTokens
@Scheduled(cron="${trustbroker.config.oidc.reapSchedule}") public void deleteExpiredTokens() -
savePenTestScenarioForBackend
public org.springframework.security.oauth2.server.authorization.OAuth2Authorization savePenTestScenarioForBackend(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization) -
applyPenTestScenarioForBackend
public void applyPenTestScenarioForBackend(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization)
-