public class YishuiAccessToken extends Object implements Serializable, org.springframework.security.oauth2.common.OAuth2AccessToken
Constructor and Description |
---|
YishuiAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken)
Copy constructor for access token.
|
YishuiAccessToken(String value)
Create an access token from the value provided.
|
Modifier and Type | Method and Description |
---|---|
void |
addAdditionalInformation(String key,
Object value)
添加一个附加信息
|
boolean |
equals(Object obj) |
Map<String,Object> |
getAdditionalInformation()
Additional information that token granters would like to add to the token,
e.g.
|
Date |
getExpiration()
The instant the token expires.
|
Integer |
getExpireInSeconds()
token的有效时间,单位为秒,默认的token有效时间,12个小时
|
int |
getExpiresIn() |
org.springframework.security.oauth2.common.OAuth2RefreshToken |
getRefreshToken()
The refresh token associated with the access token, if any.
|
Set<String> |
getScope()
The scope of the token.
|
String |
getTokenType()
The token type, as introduced in draft 11 of the OAuth 2 spec.
|
String |
getValue()
The token value.
|
int |
hashCode() |
boolean |
isExpired()
Convenience method for checking expiration
|
void |
setAdditionalInformation(Map<String,Object> additionalInformation)
Additional information that token granters would like to add to the token,
e.g.
|
void |
setExpiration(Date expiration)
设置token过期时间时间点
|
void |
setExpireInSeconds(Integer expireInSeconds)
token的有效时间,单位为秒,默认的token有效时间,12个小时
|
protected void |
setExpiresIn(int delta) |
void |
setRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken)
The refresh token associated with the access token, if any.
|
void |
setScope(Set<String> scope)
The scope of the token.
|
void |
setTokenType(String tokenType)
The token type, as introduced in draft 11 of the OAuth 2 spec.
|
void |
setValue(String value) |
String |
toString() |
static org.springframework.security.oauth2.common.OAuth2AccessToken |
valueOf(Map<String,String> tokenParams) |
public YishuiAccessToken(String value)
value
- 令牌信息public YishuiAccessToken(org.springframework.security.oauth2.common.OAuth2AccessToken accessToken)
accessToken
- OAuth2AccessTokenpublic void setValue(String value)
public String getValue()
getValue
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public int getExpiresIn()
getExpiresIn
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
protected void setExpiresIn(int delta)
public Date getExpiration()
getExpiration
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public void setExpiration(Date expiration)
expiration
- token过期时间时间点public boolean isExpired()
isExpired
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public String getTokenType()
getTokenType
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public void setTokenType(String tokenType)
tokenType
- The token type, as introduced in draft 11 of the OAuth 2
spec.public org.springframework.security.oauth2.common.OAuth2RefreshToken getRefreshToken()
getRefreshToken
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public void setRefreshToken(org.springframework.security.oauth2.common.OAuth2RefreshToken refreshToken)
refreshToken
- The refresh token associated with the access token, if
any.public Set<String> getScope()
getScope
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public void setScope(Set<String> scope)
scope
- The scope of the token.public static org.springframework.security.oauth2.common.OAuth2AccessToken valueOf(Map<String,String> tokenParams)
public Map<String,Object> getAdditionalInformation()
getAdditionalInformation
in interface org.springframework.security.oauth2.common.OAuth2AccessToken
public void setAdditionalInformation(Map<String,Object> additionalInformation)
additionalInformation
- the additional information to setpublic void addAdditionalInformation(String key, Object value)
key
- 附加信息的键,不能为空value
- 附加信息的内容,不能为空public Integer getExpireInSeconds()
public void setExpireInSeconds(Integer expireInSeconds)
expireInSeconds
- token的有效时间,单位为秒Copyright © 2021. All rights reserved.