mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-06-06 05:17:46 +08:00
优化oauth2客户端
This commit is contained in:
@@ -3,5 +3,5 @@
|
||||
# 模块说明
|
||||
| 模块 | 说明 | 进度 |
|
||||
| ------------- |:-------------:| ----|
|
||||
|[hsweb-authorization-oauth2-client](hsweb-authorization-oauth2-client)|OAuth2 客户端API| 10%|
|
||||
|[hsweb-authorization-oauth2-server](hsweb-authorization-oauth2-server)|OAuth2 服务端API| 50%|
|
||||
|[hsweb-authorization-oauth2-client](hsweb-authorization-oauth2-client)|OAuth2 客户端API| 90%|
|
||||
|[hsweb-authorization-oauth2-server](hsweb-authorization-oauth2-server)|OAuth2 服务端API| 90%|
|
||||
@@ -23,6 +23,12 @@ public class MemoryOAuth2ServerConfigRepository implements OAuth2ServerConfigRep
|
||||
return repo.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuth2ServerConfig save(OAuth2ServerConfig config) {
|
||||
repo.put(config.getId(), config);
|
||||
return config;
|
||||
}
|
||||
|
||||
public void setServers(List<OAuth2ServerConfig> servers) {
|
||||
this.servers = servers;
|
||||
repo = servers.stream()
|
||||
|
||||
@@ -46,6 +46,8 @@ public class MemoryOAuth2UserTokenRepository implements OAuth2UserTokenRepositor
|
||||
|
||||
@Override
|
||||
public AccessTokenInfo insert(AccessTokenInfo accessTokenInfo) {
|
||||
accessTokenInfo.setCreateTime(System.currentTimeMillis());
|
||||
accessTokenInfo.setUpdateTime(System.currentTimeMillis());
|
||||
if (accessTokenInfo.getId() == null) {
|
||||
accessTokenInfo.setId(IDGenerator.MD5.generate());
|
||||
}
|
||||
|
||||
@@ -8,4 +8,6 @@ import org.hswebframework.web.authorization.oauth2.client.OAuth2ServerConfig;
|
||||
*/
|
||||
public interface OAuth2ServerConfigRepository {
|
||||
OAuth2ServerConfig findById(String id);
|
||||
|
||||
OAuth2ServerConfig save(OAuth2ServerConfig config);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user