Package io.meeds.oauth2.server.dao
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 Summary
Modifier and TypeMethodDescriptionfindByAccessTokenHash(String token) findByAccessTokenValueNotNullAndPrincipalNameAndRegisteredClientId(String userName, String clientId) findByDeviceCodeHash(String token) findByOidcIdTokenHash(String token) findByPrincipalName(String username) findByPrincipalNameAndRegisteredClientId(String userName, String clientId) findByRefreshTokenHash(String token) findByRegisteredClientId(String clientId) findByStateHash(String state) findByTokenHash(String hash) findByUserCodeHash(String token) findExpiredTokens(Instant now) Methods inherited from interface org.springframework.data.repository.CrudRepository
count, delete, deleteAll, deleteAll, deleteAllById, deleteById, existsById, findById, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByStateHash
-
findByAuthorizationCodeHash
-
findByAccessTokenHash
-
findByRefreshTokenHash
-
findByOidcIdTokenHash
-
findByUserCodeHash
-
findByDeviceCodeHash
-
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
-
findByAccessTokenValueNotNullAndRegisteredClientId
-
findByRegisteredClientId
-
findByAccessTokenValueNotNullAndPrincipalName
-
findByPrincipalName
-
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)
-