---
title: "Authentication"
description: "Get an OAuth2 bearer token for the Wego API, two ways."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.wego.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Authentication

import { siteEnv } from "@/site-env";

All `/v1` operations require an OAuth2 bearer token from the Wego auth server. Two ways in, both against the auth endpoints declared in the spec's `securitySchemes`.

## Wego CLI

The easiest path. <code>{siteEnv.cliFlavor} login</code> runs the browser flow for you and stores the token locally; every CLI command then calls the API as you. See [Wego CLI](/cli).

## Any OAuth2 client

Run the OAuth2 authorization code flow with PKCE against the Wego auth server, then send the access token as `Authorization: Bearer <token>` (RFC 6750).

| Field | Value |
|---|---|
| Authorize URL | <code>{siteEnv.authAuthorizeUrl}</code> |
| Token URL | <code>{siteEnv.authTokenUrl}</code> |
| Client ID | <code>{siteEnv.clientId}</code> (public, PKCE) |
| PKCE | S256 |
| Scopes | `openid profile users` |

Source: https://docs.wego.com/authentication/index.mdx
