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

# Authentication

Obtain a short-lived Bearer access token. Use Method A (username/password) for interactive or first-time access; use Method B (Personal Access Token exchange) for automated/service integrations. Pass the resulting token in the `Authorization: Bearer <access_token>` header on every other request.

## Method A — Username / password login

> Log in with your username and password. The response contains the \`accessToken\` used as the Bearer token on subsequent calls, plus an \`idToken\` and \`refreshToken\`. Use this method for interactive or first-time access.<br>

```json
{"openapi":"3.0.3","info":{"title":"Lineaje API Documentation","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Obtain a short-lived Bearer access token. Use Method A (username/password) for interactive or first-time access; use Method B (Personal Access Token exchange) for automated/service integrations. Pass the resulting token in the `Authorization: Bearer <access_token>` header on every other request.\n"}],"servers":[{"url":"https://lineaje-identity-service.v2.prod.veedna.com","description":"Identity service"}],"security":[],"paths":{"/lineajeidentity/api/v1/login":{"post":{"tags":["Authentication"],"summary":"Method A — Username / password login","operationId":"login","description":"Log in with your username and password. The response contains the `accessToken` used as the Bearer token on subsequent calls, plus an `idToken` and `refreshToken`. Use this method for interactive or first-time access.\n","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginRequest"}}}},"responses":{"200":{"description":"Authentication succeeded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LoginResponse"}}}}}}}},"components":{"schemas":{"LoginRequest":{"type":"object","required":["username","password"],"properties":{"username":{"type":"string"},"password":{"type":"string","format":"password"}}},"LoginResponse":{"type":"object","properties":{"accessToken":{"type":"string"},"idToken":{"type":"string"},"refreshToken":{"type":"string"},"tokenType":{"type":"string"},"expiresIn":{"type":"integer"},"scope":{"type":"string"},"expiresAt":{"type":"string"}}}}}}
```

## Method B — Exchange a PAT for an access token

> Exchange a Lineaje Personal Access Token (PAT) — a long-lived refresh token — for a short-lived access token. Pass the PAT as the \`refreshToken\` query parameter; the request body is the JSON literal \`null\`. Use this method for automated/service integrations.\
> \
> The access token is short-lived (\`expires\_in\` seconds, default 3600 = 1 hour); request a new one before it expires. If the response includes a \`refresh\_token\`, replace your stored PAT with it for the next exchange. Keep your PAT secret (supply it via an environment variable such as \`LINEAJE\_PAT\_TOKEN\`). The renew endpoint can be overridden with \`LINEAJE\_RENEW\_ACCESS\_TOKEN\_URL\` for a non-default identity service.<br>

```json
{"openapi":"3.0.3","info":{"title":"Lineaje API Documentation","version":"1.0.0"},"tags":[{"name":"Authentication","description":"Obtain a short-lived Bearer access token. Use Method A (username/password) for interactive or first-time access; use Method B (Personal Access Token exchange) for automated/service integrations. Pass the resulting token in the `Authorization: Bearer <access_token>` header on every other request.\n"}],"servers":[{"url":"https://lineaje-identity-service.v2.prod.veedna.com","description":"Identity service"}],"security":[],"paths":{"/lineajeidentity/api/v1/auth/native/renew-access-token":{"post":{"tags":["Authentication"],"summary":"Method B — Exchange a PAT for an access token","operationId":"renewAccessToken","description":"Exchange a Lineaje Personal Access Token (PAT) — a long-lived refresh token — for a short-lived access token. Pass the PAT as the `refreshToken` query parameter; the request body is the JSON literal `null`. Use this method for automated/service integrations.\n\nThe access token is short-lived (`expires_in` seconds, default 3600 = 1 hour); request a new one before it expires. If the response includes a `refresh_token`, replace your stored PAT with it for the next exchange. Keep your PAT secret (supply it via an environment variable such as `LINEAJE_PAT_TOKEN`). The renew endpoint can be overridden with `LINEAJE_RENEW_ACCESS_TOKEN_URL` for a non-default identity service.\n","parameters":[{"name":"refreshToken","in":"query","required":true,"description":"Your Lineaje Personal Access Token (PAT).","schema":{"type":"string"}}],"requestBody":{"required":true,"description":"The request body is the JSON literal null.","content":{"application/json":{"schema":{"nullable":true}}}},"responses":{"200":{"description":"Access token issued (and a rotated PAT, when returned).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenewAccessTokenResponse"}}}}}}}},"components":{"schemas":{"RenewAccessTokenResponse":{"type":"object","properties":{"access_token":{"type":"string"},"refresh_token":{"type":"string","description":"Rotated refresh token, if returned."},"expires_in":{"type":"integer","description":"Seconds until the access token expires (default 3600)."}}}}}}
```


---

# 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://docs.veedna.com/sbom360/lineaje-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.
