Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HttpClient

HTTP client that includes bearer token injection and refresh. This module also supports authorization for policy protected endpoints.

Example:

return forgerock.HttpClient.request({
  url: `https://example.com/protected/resource`,
  init: {
    method: 'GET',
    credentials: 'include',
  },
  authorization: {
    handleStep: async (step) => {
      step.getCallbackOfType('PasswordCallback').setPassword(pw);
      return Promise.resolve(step);
    },
  },
});

Hierarchy

Index

Methods

addEventListener

  • addEventListener(type: string, listener: Listener): void

clearEventListeners

  • clearEventListeners(type?: string): void

dispatchEvent

  • dispatchEvent<T>(event: T): void

removeEventListener

  • removeEventListener(type: string, listener: Listener): void

Static request