---
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.

## 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
- `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' | 'email-already-in-use' | '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' | 'cannot-send-sms' | 'provider-account-already-linked', required — Error code identifying the specific application error

## Other responses

- `302` — Redirect to social provider

## Changes

- **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`
- **2025-12-18** `8fe8f76faefb` — 1 info
  - added the new optional `query` request parameter `providerSpecificParams`
- **2025-11-11** `484d9f1a422a` — 1 warning
  - added the new `provider-account-already-linked` enum value to the `error` response property for the response status `default`
- **2025-10-28** `ca6d11a13264` — 2 info
  - added the new optional `query` request parameter `state`
  - `path` request parameter `provider` was reactivated

[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/fbbb4ff76b2a/schema)
