|
|
|
@ -169,9 +169,6 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* (non-Javadoc) |
|
|
|
|
* @see org.mitre.oauth2.repository.OAuth2TokenRepository#getAccessTokensForClient(org.mitre.oauth2.model.ClientDetailsEntity) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<OAuth2AccessTokenEntity> getAccessTokensForClient(ClientDetailsEntity client) { |
|
|
|
|
TypedQuery<OAuth2AccessTokenEntity> queryA = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_BY_CLIENT, OAuth2AccessTokenEntity.class); |
|
|
|
@ -180,9 +177,6 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|
|
|
|
return accessTokens; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* (non-Javadoc) |
|
|
|
|
* @see org.mitre.oauth2.repository.OAuth2TokenRepository#getRefreshTokensForClient(org.mitre.oauth2.model.ClientDetailsEntity) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public List<OAuth2RefreshTokenEntity> getRefreshTokensForClient(ClientDetailsEntity client) { |
|
|
|
|
TypedQuery<OAuth2RefreshTokenEntity> queryR = manager.createNamedQuery(OAuth2RefreshTokenEntity.QUERY_BY_CLIENT, OAuth2RefreshTokenEntity.class); |
|
|
|
@ -233,11 +227,6 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|
|
|
|
return new LinkedHashSet<>(JpaUtil.getResultPage(query,pageCriteria)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* (non-Javadoc) |
|
|
|
|
* @see org.mitre.oauth2.repository.OAuth2TokenRepository#getAccessTokensForResourceSet(org.mitre.uma.model.ResourceSet) |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
public Set<OAuth2AccessTokenEntity> getAccessTokensForResourceSet(ResourceSet rs) { |
|
|
|
|
TypedQuery<OAuth2AccessTokenEntity> query = manager.createNamedQuery(OAuth2AccessTokenEntity.QUERY_BY_RESOURCE_SET, OAuth2AccessTokenEntity.class); |
|
|
|
@ -245,13 +234,9 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|
|
|
|
return new LinkedHashSet<>(query.getResultList()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* (non-Javadoc) |
|
|
|
|
* @see org.mitre.oauth2.repository.OAuth2TokenRepository#clearDuplicateAccessTokens() |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional(value="defaultTransactionManager") |
|
|
|
|
public void clearDuplicateAccessTokens() { |
|
|
|
|
|
|
|
|
|
Query query = manager.createQuery("select a.jwt, count(1) as c from OAuth2AccessTokenEntity a GROUP BY a.jwt HAVING count(1) > 1"); |
|
|
|
|
@SuppressWarnings("unchecked") |
|
|
|
|
List<Object[]> resultList = query.getResultList(); |
|
|
|
@ -270,9 +255,6 @@ public class JpaOAuth2TokenRepository implements OAuth2TokenRepository {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* (non-Javadoc) |
|
|
|
|
* @see org.mitre.oauth2.repository.OAuth2TokenRepository#clearDuplicateRefreshTokens() |
|
|
|
|
*/ |
|
|
|
|
@Override |
|
|
|
|
@Transactional(value="defaultTransactionManager") |
|
|
|
|
public void clearDuplicateRefreshTokens() { |
|
|
|
|