Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Unauthorized sign-in #1668

Merged
merged 34 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e7995fc
feat: Unauthorized sign-in
gkats Oct 30, 2024
ba4ea89
Update docs/customization/account-portal/overview.mdx
gkats Nov 1, 2024
e6fbd70
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
1218390
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
1984aad
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
679d0ea
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
8d9cd85
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
49e1a76
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
b87dd4a
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
205d56a
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
d207544
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
46f5b2b
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
7969b4f
Update docs/security/unauthorized-sign-in.mdx
gkats Nov 1, 2024
71075d0
fix: Run prettier
gkats Nov 1, 2024
0dff4fd
fix: Intermediate instructions for configuration
gkats Nov 1, 2024
689095a
fix: Update template name
gkats Dec 3, 2024
1849d81
Merge branch 'main' into user-766-docs
victoriaxyz Dec 3, 2024
50d5f4c
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
7097129
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
9563711
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
ad21fdc
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
643a3f5
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
c2f9624
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
3c740b9
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
591b67e
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
fdf7596
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
b85af62
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
496d97b
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
b5381ea
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
5c98dcb
fix: Update copy
gkats Dec 4, 2024
d6f4a72
Update docs/security/unauthorized-sign-in.mdx
gkats Dec 4, 2024
c36db71
fix structure of reference doc
alexisintech Dec 4, 2024
86cf7b7
update copy
alexisintech Dec 4, 2024
15a09bd
Merge branch 'main' into user-766-docs
victoriaxyz Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/customization/account-portal/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ For development environments, Clerk will issue you a randomly generated domain o
https://accounts.<your-domain>.com/sign-in
https://accounts.<your-domain>.com/sign-up
https://accounts.<your-domain>.com/user
https://accounts.<your-domain>.com/unauthorized-sign-in
https://accounts.<your-domain>.com/organization
https://accounts.<your-domain>.com/create-organization
```
Expand Down
8 changes: 8 additions & 0 deletions docs/customization/account-portal/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ The user profile page hosts the prebuilt [`<UserProfile />`](/docs/components/us

Redirect your authenticated users to their user profile page using the [`<RedirectToUserProfile />`](/docs/components/control/redirect-to-userprofile) control component.

### Unauthorized sign-in
gkats marked this conversation as resolved.
Show resolved Hide resolved

The unauthorized sign-in page doesn't host any prebuilt Clerk component. It displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, see the [Unauthorized sign-in](/docs/security/unauthorized-sign-in) feature.
alexisintech marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The unauthorized sign-in page doesn't host any prebuilt Clerk component. It displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, see the [Unauthorized sign-in](/docs/security/unauthorized-sign-in) feature.
The unauthorized sign-in page doesn't host any prebuilt Clerk component. It displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, see the [Unauthorized sign-in](/docs/security/unauthorized-sign-in) guide.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure this is a guide? I see it more as a page which explains what the feature is about.

Would it be confusing the page with the rest of the "Guides"?

image

Copy link
Member

@alexisintech alexisintech Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

firstly, I'd say to update this suggestion with the original suggestion that accidentally didn't get applied:

Suggested change
The unauthorized sign-in page doesn't host any prebuilt Clerk component. It displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, see the [Unauthorized sign-in](/docs/security/unauthorized-sign-in) feature.
The unauthorized sign-in page displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, refer to [the guide.](/docs/security/unauthorized-sign-in)

secondly, I'd call this a reference guide - it's kind of in the middle, but it's more so a reference for the "unauthorized sign in" feature, so we can call it a reference! this would update the suggestion to read:

Suggested change
The unauthorized sign-in page doesn't host any prebuilt Clerk component. It displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, see the [Unauthorized sign-in](/docs/security/unauthorized-sign-in) feature.
The unauthorized sign-in page displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, see [the reference](/docs/security/unauthorized-sign-in).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've applied the changes here c36db71


The unauthorized sign-in page displays a UI confirming that a session from an unrecognized device was successfully revoked. For more information, refer to [the reference.](/docs/security/unauthorized-sign-in)

![Clerk's Account Portal unauthorized sign-in page](/docs/images/account-portal/unauthorized-sign-in.png)

### Create organization

The create organization page hosts the prebuilt [`<CreateOrganization />`](/docs/components/organization/create-organization) component, which provides a streamlined interface for users to create new organizations within your application.
Expand Down
4 changes: 4 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,10 @@
{
"title": "Protect email link sign-ins and sign-ups",
"href": "/docs/security/email-link-protection"
},
{
"title": "Unauthorized sign-in",
"href": "/docs/security/unauthorized-sign-in"
}
]
]
Expand Down
41 changes: 41 additions & 0 deletions docs/security/unauthorized-sign-in.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Unauthorized sign-in
description: Notify users of unauthorized sign-ins to their accounts
victoriaxyz marked this conversation as resolved.
Show resolved Hide resolved
---

Clerk detects sign-in attempts from unrecognized devices to protect users from unauthorized access to their accounts. This security feature helps identify potentially malicious sign-in activity.

gkats marked this conversation as resolved.
Show resolved Hide resolved
## Email notification for unauthorized access

When a sign-in attempt is made from an unfamiliar device, Clerk notifies the account owner by email with details about the newly created session. The email notification varies depending on the instance's configuration and the application's billing plan.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed "The account owner can immediately revoke the session if it's recognized as unauthorized." as this is only available for certain supported instances. So now, we can combine the first and third sentence, and it flows very nicely.


By default, the email includes information about the unauthorized sign-in attempt, such as device type, operating system, IP address, location, and the sign-in method used. If you've set a support email for your app, Clerk will add instructions for the user to contact the app administrator.
gkats marked this conversation as resolved.
Show resolved Hide resolved

For supported instances, the email might also include a button that allows users to sign out from the unrecognized device. Selecting this button immediately revokes the session.

To customize the unauthorized sign-in email notification:
gkats marked this conversation as resolved.
Show resolved Hide resolved

1. In the Clerk Dashboard, navigate to the [**Emails**](https://dashboard.clerk.com/last-active?path=customization/email) page.
1. Select **Sign in from new device**. You'll be redirected to the template settings page.
1. Edit the email template.
1. Select **Apply changes**.

## Revoke sessions for unauthorized sign-ins

> [!WARNING]
> This feature isn't available in production for free plans but can be tested for free in development mode. For more information, see the [pricing](/pricing){{ target: '_blank' }} page.

For apps that support this feature, users can immediately revoke unauthorized sign-ins directly from the email notification. With a single click, the suspicious session is revoked and the user is redirected to a confirmation page.

The confirmation page depends on the instance configuration:

- [Account Portal](/docs/customization/account-portal/overview) enabled: The user is redirected to the [unauthorized sign-in](/docs/customization/account-portal/overview#unauthorized-sign-in) page, where content can be customized based on the app's theme.
- Account Portal disabled: The user sees a plain text confirmation of the successful session revocation.

In either case, after revoking the session, users must sign in again unless they have an active session on their device.

To customize the URL path of the unauthorized sign-in page:

1. In the Clerk Dashboard, navigate to the [**Paths**](https://dashboard.clerk.com/last-active?path=paths) page.
1. Under **Application paths**, enter the **Unauthorized sign in URL** path.
1. Select **Save**.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading