Skip to content

buildAuthUrl

buildAuthUrl(discovery, config, pkce, state, nonce, extraParams?): string

Defined in: packages/core/src/authorize.ts:26

Builds the full authorization endpoint URL with all required query parameters.

Includes PKCE challenge, state, nonce, and any caller-supplied extra parameters. Uses response_type=code and code_challenge_method=S256.

OidcDiscovery

The provider’s parsed discovery document.

OidcConfig

Client configuration; redirectUri is required for this call.

The PKCE verifier/challenge pair (only challenge is sent to the provider).

string

string

string

An opaque CSRF-protection value to round-trip through the callback.

string

A random value binding the resulting ID token to this session.

Record<string, string>

Optional additional query parameters to append to the URL.

string

The complete authorization URL to redirect the user to.

MISSING_REDIRECT_URI if config.redirectUri is not set.

  • RFC 6749 §4.1.1 — Authorization Request
  • RFC 7636 §4.3 — code_challenge and code_challenge_method
  • OpenID Connect Core 1.0 §3.1.2.1 — Authentication Request