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
    Modifier and Type
    Field
    Description
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    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 Summary

    Modifier and Type
    Method
    Description
    void
    applyPenTestScenarioForBackend(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization)
     
    void
     
    @Nullable org.springframework.security.oauth2.server.authorization.OAuth2Authorization
     
    @Nullable org.springframework.security.oauth2.server.authorization.OAuth2Authorization
    findByToken(String token, @Nullable org.springframework.security.oauth2.server.authorization.OAuth2TokenType tokenType)
     
     
    void
    save(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization)
     
    org.springframework.security.oauth2.server.authorization.OAuth2Authorization
    savePenTestScenarioForBackend(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization)
     
    void
    saveTokenExchangeSubjectToken(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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • 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:
      findById in interface org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
      Overrides:
      findById in class org.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:
      findByToken in interface org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
      Overrides:
      findByToken in class org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
    • save

      public void save(org.springframework.security.oauth2.server.authorization.OAuth2Authorization authorization)
      Specified by:
      save in interface org.springframework.security.oauth2.server.authorization.OAuth2AuthorizationService
      Overrides:
      save in class org.springframework.security.oauth2.server.authorization.JdbcOAuth2AuthorizationService
    • saveTokenExchangeSubjectToken

      @Transactional public void saveTokenExchangeSubjectToken(String subjectToken, String clientId, String principalName, Timestamp iat, Timestamp expiration)
    • getSubjectTokenCount

      @Transactional public Integer getSubjectTokenCount(String subjectToken)
    • 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)