/**
* @typedef {import('@simplewebauthn/browser').PublicKeyCredentialRequestOptionsJSON} PublicKeyCredentialRequestOptionsJSON
* @typedef {import('@simplewebauthn/browser').AuthenticationResponseJSON} AuthenticationResponseJSON
* @typedef {import('@simplewebauthn/browser').StartAuthenticationOpts} StartAuthenticationOpts
*/
/**
* Stimulus controller for WebAuthn authentication (sign-in).
*
* Usage:
* ```html
*
* ```
*/
export default class AuthenticationController extends BaseController {
static values: {
optionsUrl: {
type: StringConstructor;
default: string;
};
resultUrl: {
type: StringConstructor;
default: string;
};
submitViaForm: {
type: BooleanConstructor;
default: boolean;
};
successRedirectUri: StringConstructor;
conditionalUi: {
type: BooleanConstructor;
default: boolean;
};
verifyAutofillInput: {
type: BooleanConstructor;
default: boolean;
};
requestHeaders: {
type: ObjectConstructor;
default: {
'Content-Type': string;
Accept: string;
};
};
};
connect(): Promise;
/**
* Authenticate the user via WebAuthn.
*
* @param {Event} event Form submit event.
* @returns {Promise}
*/
authenticate(event: Event): Promise;
/**
* Start authentication with conditional UI (browser autofill).
*
* @private
* @returns {Promise}
*/
private _startAuthenticationWithConditionalUi;
/**
* Start authentication process.
*
* @private
* @param {Partial} [options] Additional options for startAuthentication.
* @returns {Promise}
*/
private _startAuthentication;
/**
* Process authentication with WebAuthn.
*
* @private
* @param {PublicKeyCredentialRequestOptionsJSON} credentialRequestOptions WebAuthn credential request options.
* @param {Partial} [startAuthenticationOptions] Options for startAuthentication call.
* @returns {Promise}
*/
private _processAuthentication;
}
export type PublicKeyCredentialRequestOptionsJSON = import("@simplewebauthn/browser").PublicKeyCredentialRequestOptionsJSON;
export type AuthenticationResponseJSON = import("@simplewebauthn/browser").AuthenticationResponseJSON;
export type StartAuthenticationOpts = import("@simplewebauthn/browser").StartAuthenticationOpts;
import BaseController from './base-controller.js';