first commit
This commit is contained in:
27
libs/api/identity/domain/src/lib/token.ts
Normal file
27
libs/api/identity/domain/src/lib/token.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/** How a client proves who it is to get tokens from the identity server. */
|
||||
export type TokenGrant =
|
||||
| {
|
||||
type: 'authorization_code';
|
||||
code: string;
|
||||
codeVerifier: string;
|
||||
redirectUri: string;
|
||||
}
|
||||
| { type: 'password'; username: string; password: string }
|
||||
| { type: 'refresh_token'; refreshToken: string };
|
||||
|
||||
export interface TokenSet {
|
||||
accessToken: string;
|
||||
refreshToken: string | null;
|
||||
/** Seconds until the access token expires. */
|
||||
expiresIn: number;
|
||||
tokenType: string;
|
||||
}
|
||||
|
||||
/** What a browser needs to start the Authorization Code + PKCE flow. */
|
||||
export interface AuthorizationConfig {
|
||||
authorizeUrl: string;
|
||||
clientId: string;
|
||||
scopes: string[];
|
||||
/** Password grant can be disabled on the identity server. */
|
||||
passwordGrant: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user