Files
certd/packages/ui/certd-server/src/plugins/plugin-oauth/api.ts
T

43 lines
877 B
TypeScript
Raw Normal View History

2025-11-26 23:25:51 +08:00
export type OnCallbackReq = {
code: string;
state: string;
2025-11-28 01:42:42 +08:00
currentURL: URL;
ticketValue: any;
2025-11-26 23:25:51 +08:00
}
export type OauthToken = {
userInfo: {
openId: string;
nickName: string;
avatar: string;
},
token: {
accessToken: string;
refreshToken: string;
expiresIn: number;
}
}
export type OnBindReq = {
2025-11-26 07:34:42 +08:00
accessToken: string;
refreshToken: string;
expiresIn: number;
idToken: string;
scope: string;
tokenType: string;
bindInfo: any;
2025-11-26 23:25:51 +08:00
}
export type OnBindReply = {
2025-11-26 07:34:42 +08:00
success: boolean;
message: string;
2025-11-26 23:25:51 +08:00
}
2025-11-28 01:42:42 +08:00
export type LoginUrlReply = {
loginUrl: string;
ticketValue: any;
}
2025-11-26 23:25:51 +08:00
export interface IOauthProvider {
buildLoginUrl: (params: { redirectUri: string, forType?: string }) => Promise<LoginUrlReply>;
2025-11-26 23:25:51 +08:00
onCallback: (params: OnCallbackReq) => Promise<OauthToken>;
2025-11-26 07:34:42 +08:00
}