Interface OAuthTokenDao

All Superinterfaces:
org.springframework.data.repository.CrudRepository<OAuthTokenEntity,String>, org.springframework.data.jpa.repository.JpaRepository<OAuthTokenEntity,String>, org.springframework.data.repository.ListCrudRepository<OAuthTokenEntity,String>, org.springframework.data.repository.ListPagingAndSortingRepository<OAuthTokenEntity,String>, org.springframework.data.repository.PagingAndSortingRepository<OAuthTokenEntity,String>, org.springframework.data.repository.query.QueryByExampleExecutor<OAuthTokenEntity>, org.springframework.data.repository.Repository<OAuthTokenEntity,String>

public interface OAuthTokenDao extends org.springframework.data.jpa.repository.JpaRepository<OAuthTokenEntity,String>
  • Method Details

    • findByStateHash

      Optional<OAuthTokenEntity> findByStateHash(String state)
    • findByAuthorizationCodeHash

      Optional<OAuthTokenEntity> findByAuthorizationCodeHash(String token)
    • findByAccessTokenHash

      Optional<OAuthTokenEntity> findByAccessTokenHash(String token)
    • findByRefreshTokenHash

      Optional<OAuthTokenEntity> findByRefreshTokenHash(String token)
    • findByOidcIdTokenHash

      Optional<OAuthTokenEntity> findByOidcIdTokenHash(String token)
    • findByUserCodeHash

      Optional<OAuthTokenEntity> findByUserCodeHash(String token)
    • findByDeviceCodeHash

      Optional<OAuthTokenEntity> findByDeviceCodeHash(String token)
    • findByTokenHash

      @Query("SELECT t from OAuthToken t\nWHERE t.stateHash = :hash\nOR t.authorizationCodeHash = :hash\nOR t.accessTokenHash = :hash\nOR t.refreshTokenHash = :hash\nOR t.oidcIdTokenHash = :hash\nOR t.userCodeHash = :hash\nOR t.deviceCodeHash = :hash\n") Optional<OAuthTokenEntity> findByTokenHash(@Param("hash") String hash)
    • findByAccessTokenValueNotNullAndPrincipalNameAndRegisteredClientId

      List<OAuthTokenEntity> findByAccessTokenValueNotNullAndPrincipalNameAndRegisteredClientId(String userName, String clientId)
    • findByPrincipalNameAndRegisteredClientId

      List<OAuthTokenEntity> findByPrincipalNameAndRegisteredClientId(String userName, String clientId)
    • findByAccessTokenValueNotNullAndRegisteredClientId

      List<OAuthTokenEntity> findByAccessTokenValueNotNullAndRegisteredClientId(String clientId)
    • findByRegisteredClientId

      List<OAuthTokenEntity> findByRegisteredClientId(String clientId)
    • findByAccessTokenValueNotNullAndPrincipalName

      List<OAuthTokenEntity> findByAccessTokenValueNotNullAndPrincipalName(String username)
    • findByPrincipalName

      List<OAuthTokenEntity> findByPrincipalName(String username)
    • findExpiredTokens

      @Query("SELECT t from OAuthToken t\nWHERE (t.authorizationCodeExpiresAt IS NULL OR t.authorizationCodeExpiresAt < :dateNow)\nAND (t.accessTokenExpiresAt IS NULL OR t.accessTokenExpiresAt < :dateNow)\nAND (t.refreshTokenExpiresAt IS NULL OR t.refreshTokenExpiresAt < :dateNow)\nAND (t.oidcIdTokenExpiresAt IS NULL OR t.oidcIdTokenExpiresAt < :dateNow)\nAND (t.userCodeExpiresAt IS NULL OR t.userCodeExpiresAt < :dateNow)\nAND (t.deviceCodeExpiresAt IS NULL OR t.deviceCodeExpiresAt < :dateNow)\n") List<OAuthTokenEntity> findExpiredTokens(@Param("dateNow") Instant now)