mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-07 22:06:31 +02:00
use api key scope when creating access tokens from api keys instead of full user scope
This commit is contained in:
@@ -156,7 +156,7 @@ public final class JwtAccessTokenBuilder implements AccessTokenBuilder {
|
||||
@Override
|
||||
public JwtAccessToken build() {
|
||||
if (SecurityUtils.getSubject().getPrincipals().getRealmNames().contains(ApiKeyRealm.NAME)) {
|
||||
throw new AuthorizationException("Cannot create access token for api keys");
|
||||
scope = Scope.valueOf(SecurityUtils.getSubject().getPrincipals().oneByType(Scope.class));
|
||||
}
|
||||
String id = keyGenerator.createKey();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user