JumpCloud: exchange the code

Overview

Trade the one-time code for a session token.

Called by the dashboard on landing.

You'll need the code.

Returns a token. On success the browser is redirected to the dashboard's /rs-sso-login/ page with the new bearer token in the token query parameter; there is no JSON body. The code works once, and expires 2 minutes after it was issued by default.

Prerequisites

Base URL

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

GET /api/v1/auth/sso/exchange

Authentication

Public (no token)

  • The one-time code is the credential.
  • The user must still have JumpCloud sign-in turned on when the code is redeemed; otherwise 400.

Rate limit

10 requests per minute, counted per client IP address. See Rate limits.

Request parameters

ParameterInTypeRequiredDescription
codequerystringYesThe one-time code from the callback redirect. 32 to 128 characters.

Request body

None.

Request payload

None.

Response body

None. On success the response is a 302 redirect.

HeaderDescription
LocationThe dashboard's /rs-sso-login/ page, with the bearer token for the user in the token query parameter.

Response payload

HTTP/1.1 302 Found
Location: https://production.shoutaboutus.com/rs-sso-login/?token=<access-token>

Examples

Success payload

See Response payload.

Error payload

400 Invalid or expired code

The code is unknown, already used or expired, or the user can no longer sign in with JumpCloud.

{
  "message": "Invalid or expired SSO code.",
  "status": "error",
  "errors": []
}

422 code missing

{
  "message": "The code field is required.",
  "errors": {
    "code": [
      "The code field is required."
    ]
  }
}

422 code too short

{
  "message": "The code field must be at least 32 characters.",
  "errors": {
    "code": [
      "The code field must be at least 32 characters."
    ]
  }
}

429 Too many requests

{
  "message": "Too Many Attempts."
}
StatusMeaning
302Signed in: redirect to the dashboard with the token.
400The code is unknown, already used or expired, or the user can no longer sign in with JumpCloud.
422code is missing, or not 32 to 128 characters.
429More than 10 requests in a minute from your IP address.
500Unexpected server error.

Example request

curl --request GET \
  --url "https://production-api.shoutaboutus.com/api/v1/auth/sso/exchange?code=<one_time_code>" \
  --header 'Accept: application/json'

Did this page help you?