
























We're excited to announce a major expansion to Clerk's OAuth capabilities! This release adds the following features to Clerk:
We have been working hard for the last few months on these features and are beyond excited to finally get them into our customers and users' hands. Many thanks to everyone who helped us to test and refine them through our early access program!
If you're a web developer, you have no doubt heard the term “OAuth” and know it's in some way related to authentication, or maybe to single sign on, but for the vast majority of engineers, this is about as far as it goes. Truth be told, OAuth is quite a confusing topic, largely because the term “OAuth” is used to refer to three entirely different features, and there is no clear way to differentiate between them. We wrote a detailed post explaining OAuth in general, as well as these three distinctions that you can read here. The key takeaway: these new features enable OAuth scoped access - allowing third-party applications to access user data with explicit permission and limited scope.
Let's recap the three OAuth use cases:
With this background out of the way, let's get into an example of how these new features work!
If you'd like to take this feature for a spin, we have a guide on how to implement OAuth scoped access into a Clerk application right here. It just takes a few minutes to configure an OAuth client in Clerk's dashboard and start using it.
If you are building an application that uses Clerk and would like to incorporate OAuth, you will want to ensure that, after the client gets an OAuth access token, they can use it to make authenticated requests into your app (the resource service) using the token. Let's look at an example of how this could be done on an API route with Clerk's Next.js SDK:
Want to help prioritize? Let us know on our roadmap which SDK you need most!
The new OAuth consent screen ensures users understand exactly what permissions they're granting before completing the OAuth flow.
The consent screen displays:

In order to avoid breaking changes and security issues, we have implemented the following settings with respect to the consent screen
You can toggle the consent screen in the settings for any individual OAuth application on the Clerk dashboard.

We strongly recommend enabling the consent screen for all OAuth applications. Without a consent screen, any logged-in user who visits an OAuth authorization URL automatically grants access to any requested scopes. The consent screen acts as a critical security checkpoint, preventing malicious applications from silently gaining access to user accounts.
Clerk now supports dynamic client registration, allowing OAuth clients to be created programmatically via API in addition to manually through the dashboard.
You can enable this feature through a toggle in your OAuth applications settings:

What is dynamic client registration? If you're unfamiliar with this OAuth extension, we cover it in detail (including real-world use cases and security considerations) in our comprehensive OAuth guide, and our documentation.
We've heard loud and clear from our users about the interest in leveraging OAuth to support MCP integrations. With this set of improvements to our OAuth capabilities, building MCP services that use Clerk as their authorization server becomes possible.
MCP services often need to access user data from various sources on behalf of AI applications. This requires robust OAuth flows with proper consent management, token verification, and security controls - exactly what Clerk's enhanced OAuth features provide. The combination of dynamic client registration (for registering MCP servers programmatically), the consent screen (for secure user authorization), and comprehensive SDK support makes Clerk an ideal authorization server for MCP implementations.
Imagine the following example of a real-world use case. Say you've built a project management tool using Clerk for authentication. With Clerk's OAuth server, you can easily expose an MCP endpoint that allows AI applications like Cursor, ChatGPT, Claude, or Windsurf to securely access your users' project data. Your users can authorize these AI tools through Clerk's consent screen, and the AI applications can then help with tasks like generating project summaries, suggesting optimizations, or automating workflows - all while maintaining secure, user-controlled access to your application's data.
We will have another post coming soon that goes into detailed implementation of building MCP services using Clerk's OAuth server. In the meantime, if you'd like to peek behind the curtains, we have a reference implementation of an MCP service using next.js and Clerk right here.
We don't yet have support for adding custom OAuth scopes, we wanted to get these new OAuth features into our users' hands as quickly as they were usable and stable, which we feel like they are now. Next on our list is implementing a way that custom scopes can be added, accepted, and checked through our SDKs. We'll have another update coming your way soon when this feature is available!
If you're interested in getting involved with early access for custom OAuth scopes, please add a vote and/or feedback to the item on our roadmap here and we'll be in touch soon!
Sort of - while Clerk previously had endpoints for OAuth, and docs for how to configure it for SSO, this implementation was built specifically for SSO integration with Shopify and was lacking several critical features that are necessary for broad usage:
With the current release, all of these points (outside of the custom scopes, but that's coming very soon) are now resolved, and we feel confident that this is a feature-complete release of a built-in OAuth server for OAuth scoped access.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。