Skip to content

Commit

Permalink
(/references/backend/user/get-user-oauth-access-token): add callout t…
Browse files Browse the repository at this point in the history
…o prefix custom providers (#1933)

Co-authored-by: Alexis Aguilar <[email protected]>
  • Loading branch information
victoriaxyz and alexisintech authored Jan 21, 2025
1 parent 9134b71 commit 1bf00ee
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### 🔎 Previews:

-

### What does this solve?
Expand Down
4 changes: 2 additions & 2 deletions docs/references/backend/user/get-user-oauth-access-token.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: '`getUserOauthAccessToken()`'
title: getUserOauthAccessToken()
description: Use Clerk's Backend SDK to retrieve the corresponding OAuth access token for a user.
---

Expand Down Expand Up @@ -27,7 +27,7 @@ function getUserOauthAccessToken(
- `provider`
- <code>oauth\_$\{[OAuthProvider](/docs/references/javascript/types/oauth#o-auth-provider)}</code>

The OAuth provider to retrieve the access token for.
The OAuth provider to retrieve the access token for. If using a custom OAuth provider, prefix the provider name with `oauth_custom_` (e.g., `oauth_custom_foo`).
</Properties>

## Example
Expand Down
4 changes: 2 additions & 2 deletions docs/references/javascript/sign-in/authenticate-with.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi

The strategy to use for authentication. The following strategies are supported:

- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth#o-auth-provider).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'enterprise_sso'`: The user will be authenticated either through SAML or OIDC depending on the configuration of their [enterprise SSO account](/docs/authentication/enterprise-connections/overview).

---
Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-in/first-factor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function prepareFirstFactor(params: PrepareFirstFactorParams): Promise<SignIn>
- `'web3_coinbase_wallet_signature'`: The verification will attempt to be completed using the user's Web3 wallet address via [Coinbase Wallet](https://www.coinbase.com/wallet). Requires `web3WalletId` parameter to be set.
- `'web3_okx_wallet_signature'`: The verification will attempt to be completed using the user's Web3 wallet address via [OKX Wallet](https://www.okx.com/help/section/faq-web3-wallet). Requires `web3WalletId` parameter to be set.
- `'passkey'`: The verification will attempt to be completed using the user's passkey.
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). [See a list of supported values for `<provider>`](/docs/references/javascript/types/oauth#o-auth-provider).
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'enterprise_sso'`: The user will be authenticated either through SAML or OIDC depending on the configuration of their [enterprise SSO account](/docs/authentication/enterprise-connections/overview).
- `'reset_password_phone_code'`: Used when the user is trying to reset their password. The user will receive a one-time code via SMS. Requires `phoneNumberId` parameter to be set.
Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-in/sign-in.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function create(params: SignInCreateParams): Promise<SignIn>
- `'email_link'`: User will receive an email magic link via email. The `identifier` parameter can also be specified to select one of the user's known email addresses. The `redirectUrl` parameter can also be specified.
- `'email_code'`: User will receive a one-time authentication code via email. The `identifier` parameter can also be specified to select one of the user's known email addresses.
- `'phone_code'`: User will receive a one-time authentication code via SMS. The `identifier` parameter can also be specified to select one of the user's known phone numbers.
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). [See a list of supported values for `<provider>`](/docs/references/javascript/types/oauth#o-auth-provider).
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'enterprise_sso'`: The user will be authenticated either through SAML or OIDC depending on the configuration of their [enterprise SSO account](/docs/authentication/enterprise-connections/overview).
- `'passkey'`: The user will be authenticated with their [passkey](/docs/authentication/configuration/sign-up-sign-in-options#passkeys).
Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-up/authenticate-with.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi

The strategy to use for authentication. The following strategies are supported:

- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth#o-auth-provider).
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'enterprise_sso'`: The user will be authenticated either through SAML or OIDC depending on the configuration of their [enterprise SSO account](/docs/authentication/enterprise-connections/overview).

Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-up/sign-up.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function create(params: SignUpCreateParams): Promise<SignUpResource>

The strategy to use for the sign-up flow. The following strategies are supported:

- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). [See a list of supported values for `<provider>`](/docs/references/javascript/types/oauth#o-auth-provider).
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'enterprise_sso'`: The user will be authenticated either through SAML or OIDC depending on the configuration of their [enterprise SSO account](/docs/authentication/enterprise-connections/overview).
- `'ticket'`: The user will be authenticated via the ticket _or token_ generated from the Backend API.
Expand Down
2 changes: 1 addition & 1 deletion docs/references/javascript/sign-up/verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function prepareVerification(params: PrepareVerificationParams): Promise<SignUpR
- `'phone_code'`: User will receive a one-time authentication code via SMS.
- `'email_code'`: Send an email with a unique token to input.
- `'email_link'`: Send an email with a link which validates sign-up.
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). [See a list of supported values for `<provider>`](/docs/references/javascript/types/oauth#o-auth-provider).
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/overview). See a list of [supported values for `<provider>`](/docs/references/javascript/types/oauth).
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
- `'enterprise_sso'`: The user will be authenticated either through SAML or OIDC depending on the configuration of their [enterprise SSO account](/docs/authentication/enterprise-connections/overview).
- `'web3_metamask_signature'`: The verification will attempt to be completed using the user's Web3 wallet address via [Metamask](https://metamask.io/). The `web3_wallet_id` parameter can also be specified to select which of the user's known Web3 wallets will be used.
Expand Down
20 changes: 10 additions & 10 deletions docs/references/javascript/types/oauth.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ title: OAuth Types
description: Types related to social providers and strategies.
---

## `OAuthStrategy`

A type that represents the OAuth strategy for a given provider.

For example, when creating a [`SignIn`](/docs/references/javascript/sign-in/sign-in#sign-in-create-params) or [`SignUp`](/docs/references/javascript/sign-up/sign-up#sign-up-create-params), you can pass the `strategy` option to specify the OAuth strategy to use.

```ts
type OAuthStrategy = `oauth_${OAuthProvider}` | CustomOAuthStrategy
```
## `OAuthProvider`
A type that represents the OAuth provider.
Expand Down Expand Up @@ -54,16 +64,6 @@ type OAuthProvider =
| 'x'
```
## `OAuthStrategy`
A type that represents the OAuth strategy for a given provider.
For example, when creating a [`SignIn`](/docs/references/javascript/sign-in/sign-in#sign-in-create-params) or [`SignUp`](/docs/references/javascript/sign-up/sign-up#sign-up-create-params), you can pass the `strategy` option to specify the OAuth strategy to use.
```ts
type OAuthStrategy = `oauth_${OAuthProvider}` | CustomOAuthStrategy
```
### `CustomOAuthStrategy`
A type that represents a custom OAuth strategy.
Expand Down

0 comments on commit 1bf00ee

Please sign in to comment.