|
@@ -19,7 +19,6 @@ import org.springframework.util.Assert;
|
|
|
|
|
|
import java.time.Instant;
|
|
|
import java.util.Collections;
|
|
|
-import java.util.Map;
|
|
|
import java.util.Set;
|
|
|
|
|
|
/**
|
|
@@ -38,7 +37,6 @@ import java.util.Set;
|
|
|
public class AccessToken extends SecurityToken {
|
|
|
private final TokenType tokenType;
|
|
|
private final Set<String> scopes;
|
|
|
- private final Map<String,Object> additionalParameters;
|
|
|
|
|
|
public static final class TokenType {
|
|
|
public static final TokenType BEARER = new TokenType("Bearer");
|
|
@@ -76,19 +74,11 @@ public class AccessToken extends SecurityToken {
|
|
|
}
|
|
|
|
|
|
public AccessToken(TokenType tokenType, String tokenValue, Instant issuedAt, Instant expiresAt, Set<String> scopes) {
|
|
|
- this(tokenType, tokenValue, issuedAt, expiresAt, scopes, Collections.emptyMap());
|
|
|
- }
|
|
|
-
|
|
|
- public AccessToken(TokenType tokenType, String tokenValue, Instant issuedAt, Instant expiresAt,
|
|
|
- Set<String> scopes, Map<String,Object> additionalParameters) {
|
|
|
-
|
|
|
super(tokenValue, issuedAt, expiresAt);
|
|
|
Assert.notNull(tokenType, "tokenType cannot be null");
|
|
|
this.tokenType = tokenType;
|
|
|
this.scopes = Collections.unmodifiableSet(
|
|
|
scopes != null ? scopes : Collections.emptySet());
|
|
|
- this.additionalParameters = Collections.unmodifiableMap(
|
|
|
- additionalParameters != null ? additionalParameters : Collections.emptyMap());
|
|
|
}
|
|
|
|
|
|
public TokenType getTokenType() {
|
|
@@ -98,8 +88,4 @@ public class AccessToken extends SecurityToken {
|
|
|
public Set<String> getScopes() {
|
|
|
return this.scopes;
|
|
|
}
|
|
|
-
|
|
|
- public Map<String, Object> getAdditionalParameters() {
|
|
|
- return additionalParameters;
|
|
|
- }
|
|
|
}
|