mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 12:37:16 +08:00
Merge pull request #17609 from djmc/new-auth0-fns
Update node-auth0 typings for client credential grants
This commit is contained in:
@@ -7,7 +7,8 @@ const management = new auth0.ManagementClient({
|
||||
|
||||
const auth = new auth0.AuthenticationClient({
|
||||
domain: '{YOUR_ACCOUNT}.auth0.com',
|
||||
clientId: '{OPTIONAL_CLIENT_ID}'
|
||||
clientId: '{OPTIONAL_CLIENT_ID}',
|
||||
clientSecret: '{OPTIONAL_CLIENT_SECRET}'
|
||||
});
|
||||
|
||||
// Using a callback.
|
||||
|
||||
23
types/auth0/index.d.ts
vendored
23
types/auth0/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for auth0 3.0
|
||||
// Type definitions for auth0 2.3
|
||||
// Project: https://github.com/auth0/node-auth0
|
||||
// Definitions by: Wilson Hobbs <https://github.com/wbhob>, Seth Westphal <https://github.com/westy92>, Amiram Korach <https://github.com/amiram>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -83,6 +83,7 @@ export interface Identity {
|
||||
|
||||
export interface AuthenticationClientOptions {
|
||||
clientId?: string;
|
||||
clientSecret?: string;
|
||||
domain: string;
|
||||
}
|
||||
|
||||
@@ -131,6 +132,16 @@ export interface ResetPasswordEmailOptions {
|
||||
connection: string;
|
||||
}
|
||||
|
||||
export interface ClientCredentialsGrantOptions {
|
||||
audience: string;
|
||||
}
|
||||
|
||||
export interface PasswordGrantOptions {
|
||||
username: string;
|
||||
password: string;
|
||||
realm?: string;
|
||||
}
|
||||
|
||||
export interface ObjectWithId {
|
||||
id: string;
|
||||
}
|
||||
@@ -187,7 +198,8 @@ export interface UnlinkAccountsResponse {
|
||||
|
||||
export interface LinkAccountsData {
|
||||
user_id: string;
|
||||
connection_id: string;
|
||||
connection_id?: string;
|
||||
provider?: string;
|
||||
}
|
||||
|
||||
export interface Token {
|
||||
@@ -254,8 +266,11 @@ export class AuthenticationClient {
|
||||
getProfile(accessToken: string): Promise<any>;
|
||||
getProfile(accessToken: string, cb: (err: Error, message: string) => void): void;
|
||||
|
||||
getCredentialsGrant(scope: string): Promise<any>;
|
||||
getCredentialsGrant(scope: string, cb: (err: Error, message: string) => void): void;
|
||||
clientCredentialsGrant(options: ClientCredentialsGrantOptions): Promise<any>;
|
||||
clientCredentialsGrant(options: ClientCredentialsGrantOptions, cb: (err: Error, response: any) => void): void;
|
||||
|
||||
passwordGrant(options: PasswordGrantOptions): Promise<any>;
|
||||
passwordGrant(options: PasswordGrantOptions, cb: (err: Error, response: any) => void): void;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user