• This function returns a User Token with a given permission structure. Depending on the param enforceValidPermissionStructure, if any invalid permission(s) exists, the method will throw an error.

    Parameters

    • authEndpoint: string

      URL for id-service authEndpoint.

    • accessToken: string

      A valid token with permission for DEV_GENERATE_USER_ACCESS_TOKEN_WITH_PERMISSIONS granted.

    • permissions: PermissionStructure[]

      The list of permissions to be assigned to the user access token. This is an array of shape { serviceId: string, permissions: string[] }.

    • Optional email: string

      Email address the user token will be generated for. If this is provided, it must be connected to an existing user. If unspecified, a pseudo-user with the following metadata will be used for generating the token.

      name: **DEV** email: dev@domain.local id: 00000000-0000-0000-0000-000000000000

    • Optional tokenExpirationInSeconds: number

      Token expiration time in seconds. If not given, will be defaulted to 2592000 (30 days).

    • enforceValidPermissionStructure: boolean = true

      A boolean indicating if the permissions passed should be validated against existing permissions.

    Returns Promise<TokenResult>

    {accessToken: string, expiresInSeconds: number, tokenType: string}.

Generated using TypeDoc