User Account

Authenticate user with credentials

Changed on

Authenticate a user using the specified method and credentials. Requires a valid session token from /initAuth.

Credential Formats by Method:

  • password: { "credentials": { "password": "your-password" } }
  • otp: { "credentials": { "otp": "123456" } } (6-digit code, valid for 10 minutes)
  • google: { "credentials": "google-id-token-string" }. The object form { "credentials": { "credential": "..." } } passes the first token check, but by code reading the second check is handed the whole object, so it ends in 500
  • microsoft: { "credentials": { "idToken": "..." } } (only idToken is read)

SAML (samlSso), generic OAuth (oauth) and Azure AD (azureAd) sign-in were removed in 1.0; this endpoint answers 400 for them. Azure AD accounts sign in with microsoft.

Multi-Step Response:

If organization uses MFA, successful authentication returns:

  • status: "success" with nextStep and allowedMethods for next step

Fully Authenticated Response:

After completing all steps:

  • message: "Fully authenticated" with accessToken (1hr) and refreshToken (7d)

Security:

  • Account locks for 24 hours after 10 consecutive failed attempts, and the owner is sent an email saying so. While it is locked, sign-in is refused with the same answer as a wrong password or code, even when the password or code is right
  • CAPTCHA may be required if enabled (pass cf-turnstile-response)
  • An email with no account gets the same status and message as a real account given a wrong password (400) or a wrong, missing or expired sign-in code (401)
  • The session token is single-use for the final step: once tokens are returned the session is gone, and sending it again answers 401

Order of checks: the session token is checked before the body, so a request without a valid x-session-token answers 401 whatever its body holds.

post/userAccount/authenticate

Request

  • Base URL
    https://app.pipeshub.com/api/v1
  • URL
    https://app.pipeshub.com/api/v1/userAccount/authenticate
  • Auth
    none required

Headers

x-session-tokenstring required

Session token received from /initAuth endpoint

Request body

method'otp' | 'password' | 'google' | 'microsoft' required

Authentication method to use. It must be one the session's current step allows; any other value, known or not, is answered 400.

emailstring email

The account's email. Used when the session was started without one (/initAuth with no email); when neither carries an email, password and code sign-in answer 500. Ignored by the external-provider methods, which take the email from the provider.

cf-turnstile-responsestring

Cloudflare Turnstile CAPTCHA token (optional, if CAPTCHA is enabled)

Example request

{
  "credentials": {
    "otp": "123456"
  }
}

Response

Authentication step successful or fully authenticated

OR

Example response

{
  "message": "Fully authenticated"
}

Changes

    • breaking

      removed subschema #4 from the request property oneOf list

    • breaking

      added the pattern ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9-]*\.)+[A-Za-z]{2,}$ to the request property

    • warning

      the request property's maxLength was set to 254

    • info

      added subschema #5 to the request property anyOf list

    • info

      removed the non-success response with the status

    • info

      added the optional property ////// to the response with the status

    • breaking

      removed the enum value azureAd of the request property

    • breaking

      removed the enum value oauth of the request property

    • breaking

      removed the enum value samlSso of the request property

    • warning

      removed the optional property ///// from the response with the status

    • warning

      removed the optional property ///// from the response with the status

    • warning

      removed the optional property ///// from the response with the status