Skip to main content

Authenticate yourself with a passkey to get an access token

POST/v2/authenticate-passkey
API version
v2
Request method
POST
Operation ID
user-authenticate-passkey

Create the challenge with POST /passkey-challenges first.

Request​

Responses​

Format
application/json
Description

Your authentication request was successful and you've got an access token.

  • expiresstring (date-time)required

    The expiration date of the token.

  • refreshTokenstringrequired

    Refresh token to refresh your access token even after it has expired.

  • tokenstringrequired

    Public token to identify yourself against the api gateway.

Content-Type: application/json

{
"expires": "1985-10-26T01:21:00.000Z",
"refreshToken": "string",
"token": "string"
}
{
"properties": {
"expires": {
"description": "The expiration date of the token.",
"format": "date-time",
"type": "string"
},
"refreshToken": {
"description": "Refresh token to refresh your access token even after it has expired.",
"type": "string"
},
"token": {
"description": "Public token to identify yourself against the api gateway.",
"type": "string"
}
},
"required": [
"token",
"refreshToken",
"expires"
],
"type": "object"
}

No response content specified.

Usage examples​

$ curl \
--fail \
--location \
-X POST \
-d '{"challengeId":"f0f86186-0a5a-45b2-aa33-502777496347","credential":{"authenticatorAttachment":"platform","clientExtensionResults":{},"id":"AN29uP9UVfVZ1X0WLKg3zA","rawId":"AN29uP9UVfVZ1X0WLKg3zA","response":{"authenticatorData":"8q2Xwa9qKcqUca3Qox8O-H9rqwjlNp1O5WHPOETZnigdAAAAAA","clientDataJSON":"eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoicmNVYTE2MzRZVWFDc0JlYXNyb1RWdWRCYjRqTlNuS3pUR3pKOUVkTGxyQSIsIm9yaWdpbiI6Imh0dHBzOi8vc3R1ZGlvLm1pdHR3YWxkLmRlIiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ","signature":"MEUCIQD7nQ352E7fNAwHcgq5mMDsoeHQ0odAgekdw9tbs-Lc1gIgSBt2yLdJV_AcNx76CMsEP-S7LoJ_E0q-y19EAEWtwLI","userHandle":"NmMxYzFkMGUtNmYwZS00YTNjLTlkM2YtNWYyZDFkMGI5YTEx"},"type":"public-key"}}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/authenticate-passkey?cookieOnly=true
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";

const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.authenticatePasskey({
"data": {
"challengeId": "f0f86186-0a5a-45b2-aa33-502777496347",
"credential": {
"authenticatorAttachment": "platform",
"clientExtensionResults": {},
"id": "AN29uP9UVfVZ1X0WLKg3zA",
"rawId": "AN29uP9UVfVZ1X0WLKg3zA",
"response": {
"authenticatorData": "8q2Xwa9qKcqUca3Qox8O-H9rqwjlNp1O5WHPOETZnigdAAAAAA",
"clientDataJSON": "eyJ0eXBlIjoid2ViYXV0aG4uZ2V0IiwiY2hhbGxlbmdlIjoicmNVYTE2MzRZVWFDc0JlYXNyb1RWdWRCYjRqTlNuS3pUR3pKOUVkTGxyQSIsIm9yaWdpbiI6Imh0dHBzOi8vc3R1ZGlvLm1pdHR3YWxkLmRlIiwiY3Jvc3NPcmlnaW4iOmZhbHNlfQ",
"signature": "MEUCIQD7nQ352E7fNAwHcgq5mMDsoeHQ0odAgekdw9tbs-Lc1gIgSBt2yLdJV_AcNx76CMsEP-S7LoJ_E0q-y19EAEWtwLI",
"userHandle": "NmMxYzFkMGUtNmYwZS00YTNjLTlkM2YtNWYyZDFkMGI5YTEx"
},
"type": "public-key"
}
},
"queryParameters": {
"cookieOnly": true
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\AuthenticatePasskey\AuthenticatePasskeyRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\User\AuthenticatePasskey\AuthenticatePasskeyRequestBody;

$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));

// TODO: Please consult the properties and constructor signature of
// AuthenticatePasskeyRequestBody to learn how to construct a valid instance
$body = new AuthenticatePasskeyRequestBody(/* TODO: ... */);

$request = (new AuthenticatePasskeyRequest(
body: $body
))
->withCookieOnly(true);
$response = $client->user()->authenticatePasskey($request);

var_dump($response->getBody();

On this page