Zum Hauptinhalt springen

Validate your second factor

POST/v2/authenticate-mfa
API-Version
v2
Request-Methode
POST
Operation-ID
user-authenticate-mfa

Request​

Responses​

Format
application/json
Beschreibung

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"
}

Kein Response-Inhalt angegeben.

Nutzungsbeispiele​

$ curl \
--fail \
--location \
-X POST \
-d '{"email":"a.lovelace@example.com","multiFactorCode":"123456","password":"string"}' \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
-H 'Content-Type: application/json' \
https://api.mittwald.de/v2/authenticate-mfa?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.authenticateMfa({
"data": {
"email": "a.lovelace@example.com",
"multiFactorCode": "123456",
"password": "string"
},
"queryParameters": {
"cookieOnly": true
}
});

assertStatus(response, 200);

use \Mittwald\ApiClient\Generated\V2\Clients\User\AuthenticateMfa\AuthenticateMfaRequest;
use \Mittwald\ApiClient\Generated\V2\Clients\User\AuthenticateMfa\AuthenticateMfaRequestBody;

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

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

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

var_dump($response->getBody();

Auf dieser Seite