Filter procedures#

Filter procedures can be used to filter items from collections. The subtype of the filter-procedure determines on what kind of items the filter can be applied on.

A filter procedure has the following structure:

function result(filterContext) {
  // use the context to get the item information and access to other useful facilities
  return true; // return true to keep the item, false to remove it
}

The main function of a filter procedure must be called result.

Function#

The result function takes one argument, which is the context of the filter.

The type of the context depends on the subtype of the filter-procedure (shown on the next sections).

result(filterContext)#

The main function of a filter procedure

Parameters:

  • filterContext - The provider context to operate on.

Returns: a boolean where true means keep the current item, false means exclude the current item.

Common API#

Filter procedures have access to all of the Common Procedure API .

API#

The following filter-procedure subtypes are supported:

  • authenticator - see Authenticator filter procedure below

Authenticator filter-procedure API#

Filter procedures of type authenticator can be used in Service Providers and Clients to filter authenticators.

Their context objects have type AuthenticatorFilterProcedureContext. They can access information about the authenticator via the AuthenticatorFilterProcedureContext#authenticator property present in that context.

Some of the authenticator object properties are listed below:

  • id: The ID of the authenticator.
  • default: whether this is the default authenticator.
  • acr: ACR of the authenticator.
  • description: A description of the authenticator.
  • url: The URL of the authenticator.
  • type: The type of the authenticator.

Was this helpful?