mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-23 15:35:06 +08:00
完成 OAuth2 的客户端模块
This commit is contained in:
@ -44,6 +44,6 @@ public interface OAuth2TokenApi {
|
||||
* @param clientId 客户端编号
|
||||
* @return 访问令牌的信息
|
||||
*/
|
||||
OAuth2AccessTokenRespDTO refreshAccessToken(String refreshToken, Long clientId);
|
||||
OAuth2AccessTokenRespDTO refreshAccessToken(String refreshToken, String clientId);
|
||||
|
||||
}
|
||||
|
@ -30,6 +30,6 @@ public class OAuth2AccessTokenCreateReqDTO implements Serializable {
|
||||
* 客户端编号
|
||||
*/
|
||||
@NotNull(message = "客户端编号不能为空")
|
||||
private Long clientId;
|
||||
private String clientId;
|
||||
|
||||
}
|
||||
|
@ -125,5 +125,6 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 系统敏感词 1002020000 =========
|
||||
ErrorCode OAUTH2_CLIENT_NOT_EXISTS = new ErrorCode(1002020000, "OAuth2 客户端不存在");
|
||||
ErrorCode OAUTH2_CLIENT_EXISTS = new ErrorCode(1002020001, "OAuth2 客户端编号已存在");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,12 @@
|
||||
package cn.iocoder.yudao.module.system.enums.auth;
|
||||
|
||||
/**
|
||||
* OAuth2.0 客户端的通用枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface OAuth2ClientConstants {
|
||||
|
||||
String CLIENT_ID_DEFAULT = "default";
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package cn.iocoder.yudao.module.system.enums.auth;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* OAuth2.0 客户端的编号枚举
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum OAuth2ClientIdEnum {
|
||||
|
||||
DEFAULT(1L); // 系统默认
|
||||
|
||||
private final Long id;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package cn.iocoder.yudao.module.system.enums.auth;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* OAuth2 授权类型(模式)的枚举
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum OAuth2GrantTypeEnum {
|
||||
|
||||
PASSWORD("password"), // 密码模式
|
||||
AUTHORIZATION_CODE("authorization_code"), // 授权码模式
|
||||
IMPLICIT("implicit"), // 简化模式
|
||||
CLIENT_CREDENTIALS("client_credentials"), // 客户端模式
|
||||
REFRESH_TOKEN("refresh_token"), // 刷新模式
|
||||
;
|
||||
|
||||
private final String grantType;
|
||||
|
||||
}
|
Reference in New Issue
Block a user