> For the complete documentation index, see [llms.txt](https://developerdocs.instructure.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developerdocs.instructure.com/services/journey/api/authentication.md).

# Authentication

Journey accepts two kinds of credentials. End-user requests authenticate with a **Canvas JWT** issued by Canvas LMS; this is the token external API consumers will use. Inter-service traffic from other Instructure services authenticates with either a static **service token** or a signed **service JWT** that Journey itself mints when calling out. Both end-user and service-token credentials are sent as `Authorization: Bearer <token>` headers.

## Canvas JWT

Canvas issues the JWT that grants access to Journey. The token must be signed with `RS256` against the issuer's JWKS endpoint (`<issuer>/internal/services/jwks`). Journey validates the signature, `iss` (issuer), and `aud` (audience) using configured values, then enforces the following claims:

* `sub` — Canvas user global ID
* `domain` — Canvas domain the token was issued for
* `user_uuid` — Canvas user UUID
* `root_account_uuid` — Canvas root account UUID
* `workflows` — must include the configured workflow name (case-insensitive)

Standard JWT claims (`jti`, `iat`, `nbf`, `exp`) are also expected. Expiration is enforced via the `exp` claim; Journey does not refresh tokens, and clients must obtain a fresh JWT from Canvas when one expires.

Tokens are extracted from the `Authorization: Bearer <token>` header only — cookies and query parameters are not consulted. Validation works identically for both REST and GraphQL requests.

On success the authenticated identity exposes:

* `id` — Canvas global user ID (from `sub`)
* `rootAccountUuid` — from `root_account_uuid`
* `issuerUrl` — from `iss`
* `internalId` — Journey's internal user UUID (provisioned on first sign-in)

### Example request

```sh
curl https://journey-server-prod.us-east-1.core.inseng.io/api/v1/programs \
  -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
```

If the token is missing, malformed, expired, signed with the wrong key, or fails any of the claim checks above, the request is rejected with `401 Unauthorized`.

## Service token

A shared-secret bearer token used by trusted callers (typically other Instructure services or operational tooling) to bypass Canvas JWT validation for select endpoints. The configured token must be at least 12 characters, and a request's `Authorization: Bearer` value must match it exactly.

### Example request

```sh
curl https://journey-server-prod.us-east-1.core.inseng.io/internal/some-endpoint \
  -H "Authorization: Bearer $SERVICE_TOKEN"
```

This credential is intended for internal use only and is not issued to external API consumers.

## Service JWT (outbound)

For outbound calls from Journey to other Instructure services, Journey mints a short-lived JWT. These tokens are signed with `HS512` using a per-service shared secret and carry the calling user's Canvas identifiers (`user_global_id`, `user_uuid`, `root_account_uuid`, `canvas_domain`) plus a `feature_slug`. Each token has a one-hour lifetime (`exp = iat + 3600`).

Journey does not accept inbound service JWTs on its own endpoints — they are only produced for downstream calls.

## Errors

A missing, malformed, or invalid token results in `401 Unauthorized`. A valid token whose subject lacks the necessary Canvas permission for the target resource results in `403 Forbidden` — see [permissions](/services/journey/api/permissions.md). For the full error envelope and additional status codes, see [errors](/services/journey/api/errors.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developerdocs.instructure.com/services/journey/api/authentication.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
