Passwordless auth method (API)
The passwordless and username-less auth method is provides by the custom auth plugin vault_plugin_auth_passkeys and needs to be registered in the plugin catalog before usage.
This documentation assumes the passkey method is mounted at the /auth/passkey
path in Vault. Since it is possible to enable auth methods at any location, please update your API calls accordingly.
A policy according to Passwordless is created and named passkey_policy.
Passkey Configuration
The passkey configuration is needed to set up the origins, the relying party ID, the relying party displayname and attached policies.
Read Passkey Configuration
Returns the set up configuration.
GET
/auth/passkey/config
Sample request
Sample response
Set Passkey Configuration
Set up the configuration to enable users to authenticate.
POST
/auth/passkey/config
Parameters
policies
(Array<string>)
- Array of all policies which will be attached to each authenticated user.rp_displayname
(string)
- A human readable Displayname for your project or website. It is used to enhance user experience and has not technical importance.rp_id
( string)
- The ID of the relying party. This must be set to your domain without scheme and port (e.g. vault-passkeys.com). It will be checked technically by the browser and the auth mechanism. The RP ID is used to identify entries in the authenticator.rp_origins
(Array<string>)
- An origin must be a Fully Qualified Domain Name (FQDN). Only request from this URL are allowed. The origin is technically checked and must be set correctly.
Sample payload
Sample request
Sample response
User management
A user object needs to be either created by an administrator and the one-time-password has to be supplied to the user or an already authenticated user (e.g. via userpass) may use the /create
endpoint for self-registration.
List users
List all users that are created at the plugin.
LIST
/auth/passkey/users
Sample request
Sample response
Read user
Retrieve user object information like the one-time-password needed for registration.
GET
/auth/passkey/users/:username
Parameters
username
(string: <required>)
- Name of the user.
Sample request
Sample response
Create user
Create a pending user object for a user to register with a one-time-password.
POST
/auth/passkey/users/:username
Parameters
username
(string: <required>)
- Name of the user.
Sample request
Delete user
Delete a user object.
DELETE
/auth/passkey/users/:username
Sample request
Reset user
This endpoint is used to reset the one-time-password and timestamp of the validation time.
POST
/auth/passkey/users/:username/reset
Parameters
username
(string: <required>)
- Name of the user.minutes
(number)
- Number of minutes that determine how long it is possible to use the one-time-password.
Sample request
Sample response
Authentication
These endpoints operate one a challenge and response sequenze. First the ceremony needs to be started at the Vault system and the returned information must be used to make the WebAuthn API calls at the client. All data used for the WebAuthn calls are url safe encoded via Base64 (-_
are used instead of +/
) for transmission. The values must be decoded into ArrayBuffer for the WebAuthn API calls.
Since a browser is needed for the WebAuthn API calls, the samples only show responses.
Registraion Init
POST
/auth/passkey/register
Parameters
operation
(string: "init")
- The operation must be set toinit
to initiate the registration ceremony.otp
(string: <required>)
- The valid one-time-password provided by an administrator.username
(string: <required>)
- Name of the user provided by an administrator.
Sample response
The response data must be decoded and passed to the navigator.credentials.create()
as parameter. The response of this call needs to be encoded and sent back to the Vault endpoint.
Registration Finish
POST
/auth/passkey/register
Parameters
operation
(string: "finish")
- The operation must be set tofinish
to finalzie the registration ceremony.otp
(string: <required>)
- The valid one-time-password provided by an administrator.username
(string: <required>)
- Name of the user provided by an administrator.credentialData
(object: <required>)
- This is the response from the authenticator, containing information like the public key of the newly created key pair.
Sample payload
Sample response
After successful registration the user is logged in and the client token is returned.
Login Init
POST
/auth/passkey/login
Parameters
operation
(string: "init")
- The operation must be set toinit
to initiate the login ceremony.
Sample response
The response data must be decoded and passed to the navigator.credentials.get()
as parameter. The response of this call needs to be encoded and sent back to the Vault endpoint.
Login Finish
POST
/auth/passkey/login
Parameters
operation
(string: "finish")
- The operation must be set tofinish
to finalzie the login ceremony.credentialData
(object: <required>)
- This is the response from the authenticator, containing information like the signature which will be validated by the plugin with the stored public key.
Sample payload
Sample response
After successful validation the user is logged in and the client token is returned.
Self-Registration
The self-registration can be performed to create a passkey account without administrator interaction. The user must be authenticated in Vault and needs the permission for this endpoint to use.
The administrator should merge the newly created passkey entitiy/alias with the one which is used to create the passkey user account.
These endpoints operate one a challenge and response sequenze. First the ceremony needs to be started at the Vault system and the returned information must be used to make the WebAuthn API calls at the client. All data used for the WebAuthn calls are url safe encoded via Base64 (-_
are used instead of +/
) for transmission. The values must be decoded into ArrayBuffer for the WebAuthn API calls.
Since a browser is needed for the WebAuthn API calls, the samples only show responses.
Init
POST
/auth/passkey/create
Parameters
operation
(string: "init")
- The operation must be set toinit
to initiate the registration ceremony.username
(string: <required>)
- A unique username must be provided to create a new account.
Sample response
The response data must be decoded and passed to the navigator.credentials.create()
as parameter. The response of this call needs to be encoded and sent back to the Vault endpoint.
Finish
POST
/auth/passkey/create
Parameters
operation
(string: "finish")
- The operation must be set tofinish
to finalize the registration ceremony.username
(string: <required>)
- A unique username must be provided to create a new account.credentialData
(object: <required>)
- This is the response from the authenticator, containing information like the public key of the newly created key pair.
Sample payload
Sample response
After successful registration the newly created passkey can be used and an Vault entitiy will be created at first login.
Credential Management
A user may add or delete passkeys or rename them on the server side for simplified identifiability.
Many authenticators only support one passkey for one relying party. If a new passkey is created the old one may be deleted on the authenticator side.
Add Passkey Init
POST
/auth/passkey/:username/credentials
Parameters
username
(string: <required>)
- The users existing username.operation
(string: "init")
- The operation must be set toinit
to initiate the registration ceremony.
Sample response
The response data must be decoded and passed to the navigator.credentials.create()
as parameter. The response of this call needs to be encoded and sent back to the Vault endpoint.
Add Passkey Finish
POST
/auth/passkey/:username/credentials
Parameters
username
(string: <required>)
- The users existing username.operation
(string: "finish")
- The operation must be set tofinish
to finalize the registration ceremony.credentialData
(object: <required>)
- This is the response from the authenticator, containing information like the public key of the newly created key pair.
Sample payload
Sample response
Delete Passkey
A user may delete its registered passkeys at the plugin.
DELETE
/auth/passkey/:username/credentials/:credentialID
Parameters
username
(string: <required>)
- The users existing username.credentialID
(string: <required>)
- The ID of the passkey entry.
Sample response
Rename Passkey
Displaynames of passkeys are not synced between clients and servers.
POST
/auth/passkey/:username/credentials/:credentialID
Parameters
username
(string: <required>)
- The users existing username.credentialID
(string: <required>)
- The ID of the passkey entry.displayName
(string: <required>)
- The new name of the passkey entry.
Last updated