User

User #


user


How to get information about the logged in user #

The user function will retrieve information about the logged in user. The function call must be passed the access-token of the logged in user to work. This function cannot be used to retrieve information about other users in the system, it is restricted solely to the logged in user.

The user data includes the FIDO2 Passkey authenticators for the user on the application. As noted, there can be more than one passkey.

URL #

    /api/appuser/user

Method #

    GET

Headers #

    access-token: "<Access Token>"

Data Parameter #

    None

Response: #

Success: #

StatusCode: #
    200 (OK)
Contents: #
    {
        appId: <uuid>,
        appUserId: <uuid>,
        handle: <email | phone_number>,
        displayName: <display name>,
        status: <'active', 'suspended'>,
        challenge: <FIDO2 challenge>,
        deviceType: <'website', 'ios', 'android', 'windows'>,
        lastLogin: "2024-09-03T13:21:34.000Z",
        userName: <user name>,
        authenticators: [
            {
                id: <authenticator_id>,
                publicKey: <public key>,
                counter: 0,
                deviceType: "multiDevice",
                credentialBackedUp: true,
                name: Cosync-Apple,
                type: "public-key",
                transports: "internal",
                platform: <authenticator platform>,
                lastUsed: "2024-09-03T13:21:34.000Z",
                createdAt: "Mon, 02 Sep 2024 14:56:46 GMT",
                updatedAt: "Mon, 02 Sep 2024 14:56:46 GMT"
            }
        ],
        createdAt: "2024-09-02T08:16:07.000Z",
        updatedAt: "2024-09-03T13:21:30.000Z",
    }

Error: #

StatusCode: #
    400 (BAD REQUEST)
    500 (INTERNAL SERVER ERROR)
Content: #
    {
        code: "<internal error code>",
        message: "<readable error description>"
    }

The internal codes are integers:

  • 401 - app no longer exists
  • 402 - app is suspended
  • 403 - missing parameter
  • 404 - user account is suspended
  • 405 - invalid access token
  • 413 - app is migrated
  • 500 - internal server error
  • 602 - invalid data