Options
All
  • Public
  • Public/Protected
  • All
Menu

Configuration for a single interceptor route

Hierarchy

  • HttpInterceptorRouteConfig

Index

Properties

Optional allowAnonymous

allowAnonymous: undefined | false | true

Allow the HTTP call to be executed anonymously, when no token is available.

When omitted (or set to false), calls that match the configuration will fail when no token is available.

Optional httpMethod

httpMethod: HttpMethod | string

The HTTP method to match on. If specified, the HTTP method of the outgoing request will be checked against this. If there is no match, the Authorization header is not attached.

The HTTP method name is case-sensitive.

Optional tokenOptions

tokenOptions: GetTokenSilentlyOptions

The options that are passed to the SDK when retrieving the access token to attach to the outgoing request.

Optional uri

uri: undefined | string

The URL to test, by supplying the URL to match. If test is a match for the current request path from the HTTP client, then an access token is attached to the request in the "Authorization" header.

If the test does not pass, the request proceeds without the access token attached.

A wildcard character can be used to match only the start of the URL.

usagenotes

'/api' - exactly match the route /api '/api/*' - match any route that starts with /api/

Optional uriMatcher

uriMatcher: undefined | ((uri: string) => boolean)

A function that will be called with the HttpRequest.url value, allowing you to do any kind of flexible matching.

If this function returns true, then an access token is attached to the request in the "Authorization" header.

If it returns false, the request proceeds without the access token attached.