ClaimsProvider procedures

ClaimsProvider procedures are used to perform custom actions on claim values.

A procedure of this type has the following structure:

Listing 301 Structure of ClaimsProvider procedures
1
2
3
4
  function result(claimsProviderContext) {
        //Return a map of claim names with their values, e.g.
        return { claimName: 'claimValue' }
  }

ClaimsProvider functions

The result function takes a single argument: the Context object.

result(claimsProviderContext)

Implementation of a claims provider.

Arguments:
  • claimsProviderContext – The context object for claims-provider-procedures.
Returns:

A map of claim names with their values.

Context

claimsProviderContext

First input argument to a claims-provider function. It contains the following attributes

claimsProviderContext.request
Returns:request the Request object sent from the client.
claimsProviderContext.attributeDataSource
Returns:attributeDataSource the Data Source object configured for the provider.
claimsProviderContext.webServiceClient
Returns:webServiceClient the WebServiceClient object configured for the provider, or null if none is configured.
claimsProviderContext.accountManager
Returns:accountManager the AccountManager object configured for the provider, or null if none is configured.
claimsProviderContext.bucket
Returns:bucket configured for the provider, or null if none is configured.
claimsProviderContext.requestedClaimAttributes
Returns:requestedClaimAttributes configured for the provider.
claimsProviderContext.scopeValues
Returns:scopeValues configured for the provider.
claimsProviderContext.userAuthenticationAttributes
Returns:userAuthenticationAttributes configured for the provider.
claimsProviderContext.client
Returns:client configured for the provider.
claimsProviderContext.describe
Returns:describe method which returns a description of the properties and methods available in the provider.