Policy evaluator configuration specifying the policies to enforce.
A branded OathPolicyEvaluatorHandle containing the native registry id.
OathError with type: 'argument_error' when policies is empty
or contains an unrecognised kind.
The score threshold used by deviceTampering is read from the credential's
server-supplied policies JSON string at evaluation time — it is not a
config parameter here.
When loggerId is omitted the evaluator inherits the logger supplied via
OathClientConfig.logger at client-creation time.
This function is synchronous. The returned handle must be passed to
createOathClient({ policyEvaluator: handle }).
import { configureOathPolicyEvaluator, createOathClient } from '@ping-identity/rn-oath';
const evaluator = configureOathPolicyEvaluator({
policies: [{ kind: 'biometricAvailable' }, { kind: 'deviceTampering' }],
});
const client = await createOathClient({ policyEvaluator: evaluator });
With an explicit logger id:
import { logger } from '@ping-identity/rn-logger';
import { configureOathPolicyEvaluator, createOathClient } from '@ping-identity/rn-oath';
const log = logger({ level: 'debug' });
const evaluator = configureOathPolicyEvaluator({
policies: [{ kind: 'biometricAvailable' }],
loggerId: log.nativeHandle.id,
});
const client = await createOathClient({ policyEvaluator: evaluator });
Registers an OATH policy evaluator configuration with the native registry and returns a branded handle that can be passed as
OathClientConfig.policyEvaluator.