/** * credentials for app authentication */ type Credentials = ClientCredentials | TokenCredentials | UserManagedIdentityCredentials | FederatedIdentityCredentials; /** * credentials for authentication * of an app via `clientId` and `clientSecret` */ type ClientCredentials = { readonly clientId: string; readonly clientSecret: string; readonly tenantId?: string; }; /** * credentials for authentication * of an app via any external auth method */ type TokenCredentials = { readonly clientId: string; readonly tenantId?: string; readonly token: (scope: string | string[], tenantId?: string) => string | Promise; }; /** * credentials for user managed identity */ type UserManagedIdentityCredentials = { readonly clientId: string; readonly tenantId?: string; }; /** * credentials for fedrated identity credentials */ type SystemFederatedIdentityCredentials = { readonly clientId: string; readonly managedIdentityType: 'system'; readonly tenantId?: string; }; type UserFederatedIdentityCredentials = { readonly clientId: string; readonly managedIdentityClientId: string; readonly managedIdentityType: 'user'; readonly tenantId?: string; }; type FederatedIdentityCredentials = SystemFederatedIdentityCredentials | UserFederatedIdentityCredentials; export type { ClientCredentials, Credentials, FederatedIdentityCredentials, TokenCredentials, UserManagedIdentityCredentials };