diff --git a/types/auth0/auth0-tests.ts b/types/auth0/auth0-tests.ts index 0f3957b557..dad8ba9641 100644 --- a/types/auth0/auth0-tests.ts +++ b/types/auth0/auth0-tests.ts @@ -481,3 +481,22 @@ management.getUsersInRole({id: "role_id", per_page: 8}).then(users => console.lo management.getUsersInRole({id: "role_id", per_page: 8}, (err, data) => console.log(data)); management.getUsersInRole({id: "role_id", include_totals: true}).then(userPage => console.log(userPage)); management.getUsersInRole({id: "role_id", include_totals: true}, (err, data) => console.log(data)); + +management.createClient({ + name: 'client' +}); + +management.createClient({ + name: 'client', + grant_types: ['implicit'], + jwt_configuration: { + lifetime_in_seconds: 300, + scopes: {}, + alg: 'RS256', + }, + encryption_key: { + pub: 'pub', + cert: 'cert', + subject: 'subject', + } +}); \ No newline at end of file diff --git a/types/auth0/index.d.ts b/types/auth0/index.d.ts index 3e74decdf1..63f0d4ed5b 100644 --- a/types/auth0/index.d.ts +++ b/types/auth0/index.d.ts @@ -174,6 +174,13 @@ export interface PermissionPage extends Page { permissions: Permission[]; } +export type Grant = + | 'authorization_code' + | 'client_credentials' + | 'implicit' + | 'password' + | 'refresh_token'; + export interface Client { /** * The name of the client. @@ -216,12 +223,26 @@ export interface Client { client_aliases?: string[]; allowed_clients?: string[]; allowed_logout_urls?: string[]; - jwt_configuration?: any; + jwt_configuration?: { + // The amount of time (in seconds) that the token will be valid after being issued + lifetime_in_seconds?: number; + scopes?: {}; + // The algorithm used to sign the JsonWebToken + alg?: 'HS256' | 'RS256'; + }; + /** + * A set of grant types that the client is authorized to use + */ + grant_types?: Grant[]; /** * Client signing keys. */ signing_keys?: string[]; - encryption_key?: any; + encryption_key?: { + pub?: string; + cert?: string; + subject?: string; + }; sso?: boolean; /** * `true` to disable Single Sign On, `false` otherwise (default: `false`)