---
title: "Sign in with an OAuth2 provider"
method: GET
path: "/signin/provider/{provider}"
tags: ["authentication"]
---

# Sign in with an OAuth2 provider

`GET /signin/provider/{provider}`

Initiate OAuth2 authentication flow with a social provider. Redirects the user to the provider's authorization page.
If the user doesn't exist and `AUTH_DISABLE_AUTO_SIGNUP` is not set, a new account will be created upon callback.
When `AUTH_DISABLE_AUTO_SIGNUP` is enabled, users must use the `/signup/provider/{provider}` endpoint to register first.

## Path parameters

- `provider` 'apple' | 'github' | 'google' | 'linkedin' | 'discord' | 'spotify' | 'twitch' | 'gitlab' | 'bitbucket' | 'workos' | 'azuread' | 'entraid' | 'strava' | 'facebook' | 'windowslive' | 'twitter', required

## Query parameters

- `allowedRoles` string[]
- `defaultRole` string
- `displayName` string
- `locale` string
- `redirectTo` string, uri
- `connect` string
- `state` string
- `providerSpecificParams` ProviderSpecificParams
  - `connection` string — (workos) Specifies the connection to use for authentication
  - `organization` string — (workos) Specifies the organization to use for authentication
- `upstreamParams` UpstreamAuthParams — Extra parameters forwarded to the upstream OAuth2 provider's authorization URL (e.g. Google's prompt or login_hint). Reserved OAuth2/OIDC parameters are rejected.
- `codeChallenge` string

## Response `default`

An error occurred while processing the request

- ErrorResponse — Standardized error response
  - `status` integer, required — HTTP status error code
  - `message` string, required — Human-friendly error message
  - `error` 'default-role-must-be-in-allowed-roles' | 'disabled-endpoint' | 'disabled-user' | 'user-already-exists' | 'email-already-verified' | 'forbidden-anonymous' | 'internal-server-error' | 'invalid-email-password' | 'invalid-request' | 'locale-not-allowed' | 'password-too-short' | 'password-in-hibp-database' | 'redirectTo-not-allowed' | 'role-not-allowed' | 'signup-disabled' | 'unverified-user' | 'user-not-anonymous' | 'invalid-pat' | 'invalid-refresh-token' | 'invalid-ticket' | 'disabled-mfa-totp' | 'no-totp-secret' | 'invalid-totp' | 'mfa-type-not-found' | 'totp-already-active' | 'invalid-state' | 'oauth-token-echange-failed' | 'oauth-profile-fetch-failed' | 'oauth-provider-error' | 'invalid-otp' | 'otp-too-many-attempts' | 'cannot-send-sms' | 'provider-account-already-linked', required — Error code identifying the specific application error

## Other responses

- `302` — Redirect to social provider

## Changes

- **2026-07-31** `a5c0d88b55c4` — 1 info
  - added the new optional `query` request parameter `upstreamParams`
- **2026-06-24** `0fc5fd589dbf` — 1 warning
  - added the new `otp-too-many-attempts` enum value to the `error` response property for the response status `default`
- **2026-04-20** `b39086c84b43` — 1 warning, 1 info
  - added the new `user-already-exists` enum value to the `error` response property for the response status `default`
  - removed the `email-already-in-use` enum value from the `error` response property for the response status `default`
- **2026-03-27** `fbbb4ff76b2a` — 1 info
  - added the new optional `query` request parameter `codeChallenge`
- **2026-01-13** `7560a2934be4` — 1 info
  - for the `query` request parameter `locale`, the maxLength was increased from `2` to `3`

[Full history](https://skmtc.dev/nhost/apis/nhost-authentication-api/changes/signin/provider/:provider/get.md)

---

[API](https://skmtc.dev/nhost/apis/nhost-authentication-api.md) · [All operations](https://skmtc.dev/nhost/apis/nhost-authentication-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/nhost/nhost-authentication-api/revisions/a5c0d88b55c4/schema)
