feat: layui前端应用管理增加“令牌类型”配置
This commit is contained in:
@@ -33,7 +33,7 @@ public class Client extends SuperEntity {
|
||||
private String additionalInformation = "{}";
|
||||
private String autoapprove = "true";
|
||||
/**
|
||||
* token格式: reference 引用令牌(不透明), self-contained 自包含令牌(jwt))
|
||||
* 令牌类型: reference 引用令牌(不透明), self-contained 自包含令牌(jwt))
|
||||
*/
|
||||
private String tokenFormat = "reference";
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ public class RedisTokensServiceImpl implements ITokensService {
|
||||
if (authorization != null) {
|
||||
OAuth2AccessToken accessToken = authorization.getAccessToken().getToken();
|
||||
if (accessToken != null && accessToken.getExpiresAt() != null) {
|
||||
tokenVo.setExpiration(Date.from(accessToken.getExpiresAt().plus(8, ChronoUnit.HOURS)));
|
||||
tokenVo.setExpiration(Date.from(accessToken.getExpiresAt()));
|
||||
}
|
||||
tokenVo.setUsername(authorization.getPrincipalName());
|
||||
tokenVo.setClientId(authorization.getRegisteredClientId());
|
||||
|
||||
@@ -30,7 +30,8 @@ public class RegisteredClientService {
|
||||
|
||||
public void saveClient(Client client) throws Exception {
|
||||
clientService.saveClient(client);
|
||||
redisson.getBucket(clientRedisKey(client.getClientId())).set(client);
|
||||
ClientDto clientDto = BeanUtil.copyProperties(client, ClientDto.class);
|
||||
redisson.getBucket(clientRedisKey(client.getClientId())).set(clientDto);
|
||||
}
|
||||
|
||||
public PageResult<ClientDto> listClient(Map<String, Object> params, boolean isPage) {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
, scope, authorized_grant_types, autoapprove
|
||||
, access_token_validity accessTokenValiditySeconds
|
||||
, refresh_token_validity refreshTokenValiditySeconds
|
||||
, support_id_token, refresh_token_validity
|
||||
, token_format
|
||||
from oauth_client_details
|
||||
<include refid="where"/>
|
||||
</select>
|
||||
|
||||
Reference in New Issue
Block a user