Commit 7815effb authored by Matija Obreza's avatar Matija Obreza
Browse files

Updates to OAuth token management

parent e9e6e37b
......@@ -28,5 +28,5 @@ public interface OAuth2ClientDetailsService extends ClientDetailsService, Client
Collection<OAuthAccessToken> findTokensByClientId(String clientId);
Collection<OAuthAccessToken> findTokensByUserName(String userName);
Collection<OAuthAccessToken> findTokensByUserUuid(String uuid);
}
......@@ -69,8 +69,8 @@ public class OAuth2ClientDetailsServiceImpl implements OAuth2ClientDetailsServic
}
@Override
public Collection<OAuthAccessToken> findTokensByUserName(String userName) {
return accessTokenPersistence.findByUserName(userName);
public Collection<OAuthAccessToken> findTokensByUserUuid(String uuid) {
return accessTokenPersistence.findByUserName(uuid);
}
@Override
......
......@@ -67,7 +67,7 @@ public class OAuthManagementController extends BaseController {
@RequestMapping("/user/{uuid}/tokens")
@PreAuthorize("hasRole('ADMINISTRATOR') || principal.user.uuid == #uuid")
public String getIssuedTokens(@PathVariable("uuid") String uuid, Model model) {
Collection<OAuthAccessToken> tokens = clientDetailsService.findTokensByUserName(uuid);
Collection<OAuthAccessToken> tokens = clientDetailsService.findTokensByUserUuid(uuid);
model.addAttribute("tokens", tokens);
return "/oauth/tokenslist";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment