ping-identity
    Preparing search index...

    Function createOathClient

    • Create a native-backed OATH client.

      Parameters

      Returns Promise<OathClient>

      A promise that resolves to an OathClient handle.

      The factory is async because it calls the native create method to initialise the OATH session and obtain an opaque handle string. Keep a reference to the returned client and call OathClient.close when it is no longer needed to release native resources.

      OathError when the native OATH module fails to initialise.

      Basic usage:

      const client = await createOathClient();
      const credentials = await client.getCredentials();
      await client.close();

      With a logger:

      import { logger } from '@ping-identity/rn-logger';

      const log = logger({ level: 'debug' });
      const client = await createOathClient({ logger: log });
      const code = await client.generateCode('my-credential-id');
      await client.close();