Skip to content

Commit e3a9d04

Browse files
feat: add docs for authenticateWithPopup (#2188)
Co-authored-by: Alexis Aguilar <[email protected]>
1 parent 9f08757 commit e3a9d04

File tree

6 files changed

+198
-1
lines changed

6 files changed

+198
-1
lines changed

docs/components/authentication/sign-in.mdx

+13
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ All props are optional.
5050

5151
---
5252

53+
- `oauthFlow`
54+
- `"redirect" | "popup" | "auto"`
55+
56+
Determines how OAuth authentication is performed. Accepts the following properties:
57+
58+
- `"redirect"`: Redirect to the OAuth provider on the current page.
59+
- `"popup"`: Open a popup window.
60+
- `"auto"`: Choose the best method based on whether the current domain typically requires the `"popup"` flow to correctly perform authentication.
61+
62+
Defaults to `"auto"`.
63+
64+
---
65+
5366
- `path`
5467
- `string`
5568

docs/components/authentication/sign-up.mdx

+13
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,19 @@ All props are optional.
5050

5151
---
5252

53+
- `oauthFlow`
54+
- `"redirect" | "popup" | "auto"`
55+
56+
Determines how OAuth authentication is performed. Accepts the following properties:
57+
58+
- `"redirect"`: Redirect to the OAuth provider on the current page.
59+
- `"popup"`: Open a popup window.
60+
- `"auto"`: Choose the best method based on whether the current domain typically requires the `"popup"` flow to correctly perform authentication.
61+
62+
Defaults to `"auto"`.
63+
64+
---
65+
5366
- `path`
5467
- `string`
5568

docs/components/unstyled/sign-in-button.mdx

+13
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ The `<SignInButton>` component is a button that links to the sign-in page or dis
2929

3030
---
3131

32+
- `oauthFlow`
33+
- `"redirect" | "popup" | "auto"`
34+
35+
Determines how OAuth authentication is performed. Accepts the following properties:
36+
37+
- `"redirect"`: Redirect to the OAuth provider on the current page.
38+
- `"popup"`: Open a popup window.
39+
- `"auto"`: Choose the best method based on whether the current domain typically requires the `"popup"` flow to correctly perform authentication.
40+
41+
Defaults to `"auto"`.
42+
43+
---
44+
3245
- `signUpForceRedirectUrl?`
3346
- `string`
3447

docs/components/unstyled/sign-up-button.mdx

+13
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,19 @@ The `<SignUpButton>` component is a button that links to the sign-up page or dis
2929

3030
---
3131

32+
- `oauthFlow`
33+
- `"redirect" | "popup" | "auto"`
34+
35+
Determines how OAuth authentication is performed. Accepts the following properties:
36+
37+
- `"redirect"`: Redirect to the OAuth provider on the current page.
38+
- `"popup"`: Open a popup window.
39+
- `"auto"`: Choose the best method based on whether the current domain typically requires the `"popup"` flow to correctly perform authentication.
40+
41+
Defaults to `"auto"`.
42+
43+
---
44+
3245
- `signInForceRedirectUrl?`
3346
- `string`
3447

docs/references/javascript/sign-in.mdx

+70
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,76 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi
332332
For OAuth connections, see the [custom flow for OAuth connections](/docs/custom-flows/oauth-connections).
333333
For enterprise connections, see the [custom flow for enterprise connections](/docs/custom-flows/enterprise-connections).
334334

335+
### `authenticateWithPopup()`
336+
337+
Opens a popup window to allow a user to sign in via a Single Sign On (SSO) connection, such as OAuth or SAML, where an external account is used for verifying the user's identity.
338+
339+
```typescript
340+
function authenticateWithPopup(params: AuthenticateWithPopupParams): Promise<void>
341+
```
342+
343+
#### `AuthenticateWithPopupParams`
344+
345+
<Properties>
346+
- `continueSignUp?`
347+
- `boolean | undefined`
348+
349+
Whether to continue (i.e. PATCH) an existing `SignUp` (if present) or create a new `SignUp`.
350+
351+
---
352+
353+
- `emailAddress?`
354+
- `string | undefined`
355+
356+
The email address used to target an enterprise connection during sign-in.
357+
358+
---
359+
360+
- `identifier?`
361+
- `string | undefined`
362+
363+
The ID used to target an enterprise connection during sign-in.
364+
365+
---
366+
367+
- `legalAccepted?`
368+
- `boolean | undefined`
369+
370+
A boolean indicating whether the user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
371+
372+
---
373+
374+
- `popup?`
375+
- `Window | null`
376+
377+
A reference to a popup window opened via `window.open()`.
378+
379+
---
380+
381+
- `redirectUrl`
382+
- `string`
383+
384+
The full URL or path that the OAuth provider should redirect to after successful authorization on their part. Typically, this will be a simple `/sso-callback` route that calls [`Clerk.handleRedirectCallback`](/docs/references/javascript/clerk#handle-redirect-callback) or mounts the [`<AuthenticateWithRedirectCallback />`](/docs/components/control/authenticate-with-callback) component. See the [custom flow](/docs/custom-flows/oauth-connections) for implementation details.
385+
386+
---
387+
388+
- `redirectUrlComplete`
389+
- `string`
390+
391+
The full URL or path that the user will be redirected to once the sign-in is complete.
392+
393+
---
394+
395+
- `strategy`
396+
- <code>[OAuthStrategy](/docs/references/javascript/types/sso#o-auth-strategy) | 'saml' | 'enterprise\_sso'</code>
397+
398+
The strategy to use for authentication. The following strategies are supported:
399+
400+
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/oauth). See a list of [supported values for `<provider>`](/docs/references/javascript/types/sso).
401+
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
402+
- `'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).
403+
</Properties>
404+
335405
### `authenticateWithWeb3()`
336406

337407
Initiates a Web3 authentication flow by verifying the user's ownership of a blockchain wallet address through cryptographic signature verification. This method enables decentralized authentication without requiring traditional credentials.

docs/references/javascript/sign-up.mdx

+76-1
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi
331331
- `continueSignUp`
332332
- `boolean | undefined`
333333

334-
Whether to continue (i.e. PATCH) an existing \[`SignUp`]\[signup-ref] (if present) or create a new \[`SignUp`]\[signup-ref].
334+
Whether to continue (i.e. PATCH) an existing `SignUp` (if present) or create a new `SignUp`.
335335

336336
---
337337

@@ -371,6 +371,81 @@ function authenticateWithRedirect(params: AuthenticateWithRedirectParams): Promi
371371
For OAuth connections, see the [custom flow for OAuth connections](/docs/custom-flows/oauth-connections).
372372
For enterprise connections, see the [custom flow for enterprise connections](/docs/custom-flows/enterprise-connections).
373373

374+
### `authenticateWithPopup()`
375+
376+
Opens a popup window to allow a user to sign up via a Single Sign On (SSO) connection, such as OAuth or SAML, where an external account is used for verifying the user's identity.
377+
378+
```typescript
379+
function authenticateWithPopup(params: AuthenticateWithPopupParams): Promise<void>
380+
```
381+
382+
#### `AuthenticateWithPopupParams`
383+
384+
<Properties>
385+
- `redirectUrl`
386+
- `string`
387+
388+
The full URL or path that the OAuth provider should redirect to after successful authorization on their part. Typically, this will be a simple `/sso-callback` route that either calls [`Clerk.handleRedirectCallback`](/docs/references/javascript/clerk#handle-redirect-callback) or mounts the [`<AuthenticateWithRedirectCallback />`](/docs/components/control/authenticate-with-callback) component. See the [custom flow](/docs/custom-flows/oauth-connections) for implementation details.
389+
390+
---
391+
392+
- `redirectUrlComplete`
393+
- `string`
394+
395+
The full URL or path to navigate to after the OAuth or SAML flow completes.
396+
397+
---
398+
399+
- `strategy`
400+
- `'oauth_<provider>' | 'saml' | 'enterprise_sso'`
401+
402+
The strategy to use for authentication. The following strategies are supported:
403+
404+
- `'oauth_<provider>'`: The user will be authenticated with their [social connection account](/docs/authentication/social-connections/oauth). See a list of [supported values for `<provider>`](/docs/references/javascript/types/sso).
405+
- `'saml'` (deprecated): **Deprecated in favor of `'enterprise_sso'`.** The user will be authenticated with their [SAML account](/docs/authentication/enterprise-connections/overview#saml).
406+
- `'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).
407+
408+
---
409+
410+
- `continueSignUp?`
411+
- `boolean | undefined`
412+
413+
Whether to continue (i.e. PATCH) an existing `SignUp` (if present) or create a new `SignUp`.
414+
415+
---
416+
417+
- `emailAddress?`
418+
- `string | undefined`
419+
420+
Email address to use for targeting an enterprise connection at sign-up.
421+
422+
---
423+
424+
- `identifier?`
425+
- `string | undefined`
426+
427+
Identifier to use for targeting an enterprise connection at sign-up.
428+
429+
---
430+
431+
- `legalAccepted?`
432+
- `boolean`
433+
434+
A boolean indicating whether the user has agreed to the [legal compliance](/docs/authentication/configuration/legal-compliance) documents.
435+
436+
---
437+
438+
- `popup?`
439+
- `Window`
440+
441+
A reference to a popup window opened via `window.open()`.
442+
</Properties>
443+
444+
#### Example
445+
446+
For OAuth connections, see the [custom flow for OAuth connections](/docs/custom-flows/oauth-connections).
447+
For enterprise connections, see the [custom flow for enterprise connections](/docs/custom-flows/enterprise-connections).
448+
374449
### `authenticateWithWeb3()`
375450

376451
Initiates a Web3 authentication flow by verifying the user's ownership of a blockchain wallet address through cryptographic signature verification. This method enables decentralized authentication without requiring traditional credentials.

0 commit comments

Comments
 (0)