diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index b84e92e223..08a866e9b1 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -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. diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 3025b8d380..e9db9632d6 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -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; } @@ -254,8 +265,11 @@ export class AuthenticationClient { getProfile(accessToken: string): Promise; getProfile(accessToken: string, cb: (err: Error, message: string) => void): void; - getCredentialsGrant(scope: string): Promise; - getCredentialsGrant(scope: string, cb: (err: Error, message: string) => void): void; + clientCredentialsGrant(options: ClientCredentialsGrantOptions): Promise; + clientCredentialsGrant(options: ClientCredentialsGrantOptions, cb: (err: Error, response: any) => void): void; + + passwordGrant(options: PasswordGrantOptions): Promise; + passwordGrant(options: PasswordGrantOptions, cb: (err: Error, response: any) => void): void; }