Rename SecurityToken -> AbstractOAuth2Token
Fixes gh-4646
This commit is contained in:
@@ -22,18 +22,18 @@ import java.io.Serializable;
|
||||
import java.time.Instant;
|
||||
|
||||
/**
|
||||
* Base class for <i>Security Token</i> implementations.
|
||||
* Base class for <i>OAuth 2.0 Token</i> implementations.
|
||||
*
|
||||
* @author Joe Grandja
|
||||
* @since 5.0
|
||||
*/
|
||||
public abstract class SecurityToken implements Serializable {
|
||||
public abstract class AbstractOAuth2Token implements Serializable {
|
||||
private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;
|
||||
private final String tokenValue;
|
||||
private final Instant issuedAt;
|
||||
private final Instant expiresAt;
|
||||
|
||||
protected SecurityToken(String tokenValue, Instant issuedAt, Instant expiresAt) {
|
||||
protected AbstractOAuth2Token(String tokenValue, Instant issuedAt, Instant expiresAt) {
|
||||
Assert.hasText(tokenValue, "tokenValue cannot be empty");
|
||||
Assert.notNull(issuedAt, "issuedAt cannot be null");
|
||||
Assert.notNull(expiresAt, "expiresAt cannot be null");
|
||||
@@ -63,7 +63,7 @@ public abstract class SecurityToken implements Serializable {
|
||||
return false;
|
||||
}
|
||||
|
||||
SecurityToken that = (SecurityToken) obj;
|
||||
AbstractOAuth2Token that = (AbstractOAuth2Token) obj;
|
||||
|
||||
if (!this.getTokenValue().equals(that.getTokenValue())) {
|
||||
return false;
|
||||
@@ -22,7 +22,7 @@ import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* An implementation of a {@link SecurityToken} representing an <i>OAuth 2.0 Access Token</i>.
|
||||
* An implementation of an {@link AbstractOAuth2Token} representing an <i>OAuth 2.0 Access Token</i>.
|
||||
*
|
||||
* <p>
|
||||
* An access token is a credential that represents an authorization
|
||||
@@ -34,7 +34,7 @@ import java.util.Set;
|
||||
* @since 5.0
|
||||
* @see <a target="_blank" href="https://tools.ietf.org/html/rfc6749#section-1.4">Section 1.4 Access Token</a>
|
||||
*/
|
||||
public class AccessToken extends SecurityToken {
|
||||
public class AccessToken extends AbstractOAuth2Token {
|
||||
private final TokenType tokenType;
|
||||
private final Set<String> scopes;
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package org.springframework.security.oauth2.oidc.core;
|
||||
|
||||
import org.springframework.security.oauth2.core.SecurityToken;
|
||||
import org.springframework.security.oauth2.core.AbstractOAuth2Token;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.time.Instant;
|
||||
@@ -24,7 +24,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* An implementation of a {@link SecurityToken} representing an <i>OpenID Connect Core 1.0 ID Token</i>.
|
||||
* An implementation of an {@link AbstractOAuth2Token} representing an <i>OpenID Connect Core 1.0 ID Token</i>.
|
||||
*
|
||||
* <p>
|
||||
* The <code>IdToken</code> is a security token that contains "Claims"
|
||||
@@ -32,13 +32,13 @@ import java.util.Map;
|
||||
*
|
||||
* @author Joe Grandja
|
||||
* @since 5.0
|
||||
* @see SecurityToken
|
||||
* @see AbstractOAuth2Token
|
||||
* @see IdTokenClaimAccessor
|
||||
* @see StandardClaimAccessor
|
||||
* @see <a target="_blank" href="http://openid.net/specs/openid-connect-core-1_0.html#IDToken">ID Token</a>
|
||||
* @see <a target="_blank" href="http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims">Standard Claims</a>
|
||||
*/
|
||||
public class IdToken extends SecurityToken implements IdTokenClaimAccessor {
|
||||
public class IdToken extends AbstractOAuth2Token implements IdTokenClaimAccessor {
|
||||
private final Map<String, Object> claims;
|
||||
|
||||
public IdToken(String tokenValue, Instant issuedAt, Instant expiresAt, Map<String, Object> claims) {
|
||||
|
||||
Reference in New Issue
Block a user