Skip to main content
POST
/
v1
/
auth
/
webauthn
/
registrations
/
begin
Initiate WebAuthn Registration (beta)
curl --request POST \
  --url https://api.moonkey.fun/v1/auth/webauthn/registrations/begin \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "domain": "localhost",
  "user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}'
{
  "public_key_credential_creation_options": {
    "publicKey": {
      "challenge": "pz6ZOb3m7DnCLh+r7jFBymXY4N1Opz99hzAiVTTsRxU=",
      "rp": {
        "name": "My App",
        "id": "localhost"
      },
      "user": {
        "name": "John Smith",
        "displayName": "John",
        "id": "dXNlcl8yNmw3ZGJmQVk1OWZ0ZWptbTZtM09UZjRvejE="
      },
      "pubKeyCredParams": [
        {
          "type": "public-key",
          "alg": -7
        }
      ],
      "authenticatorSelection": {
        "authenticatorAttachment": "platform",
        "userVerification": "discouraged"
      },
      "timeout": 60000,
      "excludeCredentials": [
        {
          "type": "public-key",
          "id": "AQIWquELcChySRRIz9LpkduwNywFhzzKxsZye7Ms/t1noz72KiECL7tNSehkJGRwK22tlPdUBddfnyvjXQtfAJGa6oQ68D0LYLZlIleHyCin89yyZaZ9"
        }
      ]
    }
  },
  "user_id": "user_24wFP9pDa9YiMJLun94iKykoZs2"
}

Authorizations

Authorization
string
header
required

Auth Platform API includes all the Auth related features. All Users, Phone Numbers, Emails, and OTPs are associated with an App as the container.

Endpoints only accept App's Secret API keys other than certain endpoints that are used client side or via SDK that accept the public_token.

Authentication using App Api Key

Header:

Authorization: Bearer {api_key}

Authenticated Request

curl \
-X GET https://api.moonkey.fun/v1/auth/users/user_24wFP9pDa9YiMJLun94iKykoZs2 \
-H "Authorization: Bearer sk_test_pRqweh3wvWmJAAVYv7Z0T5iPLzFM4ql0muoyQcjOxGeN3p1r"

Body

application/json
domain
string
required

Required Domain of the app that will be using WebAuthn to provide user sign in.

Minimum length: 1
user_id
string
required

Required User ID of the user to attach this WebAuthn registration to.

Minimum length: 1
authenticator_type
string

Optional The intended authenticator type for the WebAuthn device used. cross-platform is recommended for portable WebAuthn device like YubiKey and platform if you want to enable log in via platform specific methods such as FaceID or TouchID. Possible values: platform, cross-platform. Defaults to platform.

Minimum length: 1

Response

200 - application/json

OK

public_key_credential_creation_options
object
required
user_id
string
required
Minimum length: 1