Ejemplo n.º 1
0
 @Override
 public OAuth2RefreshToken readRefreshToken(String accessToken) {
   /*Query query = new Query();
   query.addCriteria(Criteria.where("tokenId").is(accessToken));
   OAuth2AuthenticationRefreshToken token = mongoTemplate.findOne(query, OAuth2AuthenticationRefreshToken.class, "oauth2_refresh_token");*/
   OAuth2AuthenticationRefreshToken token = oAuth2RefreshTokenDao.findByTokenId(accessToken);
   return token.getoAuth2RefreshToken();
 }
Ejemplo n.º 2
0
 @Override
 public OAuth2Authentication readAuthenticationForRefreshToken(OAuth2RefreshToken token) {
   /*Query query = new Query();
   query.addCriteria(Criteria.where("tokenId").is(token.getValue()));
   OAuth2AuthenticationRefreshToken auth2AuthenticationRefreshToken = mongoTemplate.findOne(query, OAuth2AuthenticationRefreshToken.class, "oauth2_refresh_token");*/
   OAuth2AuthenticationRefreshToken auth2AuthenticationRefreshToken =
       oAuth2RefreshTokenDao.findByTokenId(token.getValue());
   return auth2AuthenticationRefreshToken.getAuthentication();
 }