MCPcopy
hub / github.com/supertokens/supertokens-core

github.com/supertokens/supertokens-core @v11.4.5 sqlite

repository ↗ · DeepWiki ↗ · release v11.4.5 ↗
7,108 symbols 55,124 edges 795 files 161 documented · 2%
README

SuperTokens banner

Open-Source auth provider

chat on Discord Docker pull stats

Add secure login and session management to your apps. SDKs available for popular languages and front-end frameworks e.g. Node.js, Go, Python, React.js, React Native, Vanilla JS, etc.

Architecture Diagram Supertokens architecture is optimized to add secure authentication for your users without compromising on user and developer experience

Three building blocks of SuperTokens architecture

  1. Frontend SDK: Manages session tokens and renders login UI widgets
  2. Backend SDK: Provides APIs for sign-up, sign-in, signout, session refreshing, etc. Your Frontend will talk to these APIs
  3. SuperTokens Core: The HTTP service for the core auth logic and database operations. This service is used by the Backend SDK

Features

Click here to get started

  • Passwordless Login
  • Social Login
  • Email Password Login
  • Phone Password Login
  • Session Management
  • Multi-Factor Authentication
  • Multi Tenancy / Organization Support (Enterprise SSO)
  • User Roles
  • Microservice Authentication

Learn more

If you like our project, please :star2: this repository! For feedback, feel free to join our Discord, or create an issue on this repo

🚀 What is SuperTokens?

SuperTokens is an open-core alternative to proprietary login providers like Auth0 or AWS Cognito. We are different because we offer:

  • Open source: SuperTokens can be used for free, forever, with no limits on the number of users.
  • An on-premises deployment so that you control 100% of your user data, using your own database.
  • An end-to-end solution with login, sign-ups, user and session management, without all the complexities of OAuth protocols.
  • Ease of implementation and higher security.
  • Extensibility: Anyone can contribute and make SuperTokens better!

Philosophy

Authentication directly affects the UX, dev experience, and security of any app. We believe that current solutions cannot optimize for all three "pillars", leading to many applications hand-rolling their own auth. This not only leads to security issues but is also a massive time drain.

We want to change that - we believe the only way is to provide a solution that has the right level of abstraction gives you maximum control, is secure, and is simple to use - just like if you build it yourself, from scratch (minus the time to learn, build, and maintain).

We also believe in the principle of least vendor lock-in. Your having full control of your user's data means that you can switch away from SuperTokens without forcing your existing users to logout, reset their passwords, or in the worst case, sign up again.

Click here to see the demo app.

  • Please visit our website to see the list of features.
  • We want to make features as decoupled as possible. This means you can use SuperTokens for just login, or just session management, or both. In fact, we also offer session management integrations with other login providers like Auth0.

Documentation

The docs can be seen on our website.

There is more information about SuperTokens on the GitHub wiki section.

🏗️ Architecture

Please find an architecture diagram here

For more information, please visit our GitHub wiki section.

☕ Why Java?

  • ✅ Whilst running Java can seem difficult, we provide the JDK along with the binary/docker image when distributing it. This makes running SuperTokens just like running any other HTTP microservice.
  • ✅ Java has a very mature ecosystem. This implies that third-party libraries have been battle-tested.
  • ✅ Java's strong type system ensures fewer bugs and easier maintainability. This is especially important when many people are expected to work on the same project.
  • ✅ Our team is most comfortable with Java and hiring great Java developers is relatively easy as well.
  • ✅ One of the biggest criticisms of Java is memory usage. We have three solutions to this:
    • The most frequent auth-related operation is session verification - this happens within the backend SDK (node, python, Go) without contacting the Java core. Therefore, a single instance of the core can handle several 10s of thousands of users fairly easily.
    • We have carefully chosen our dependencies. For eg: we use an embedded tomcat server instead of a higher-level web framework.
    • We also plan on using GraalVM in the future and this can reduce memory usage by 95%!
  • ✅ If you require any modifications to the auth APIs, those would need to be done on the backend SDK level (for example Node, Golang, Python..). So you’d rarely need to directly modify/work with the Java code in this repo.

⌨️ User Management Dashboard

Oversee your users with the SuperTokens User Management Dashboard

List users

List all the users who have signed up to your application.

List SuperTokens users

Manage users

Manage users by modifying or deleting their sessions, metadata, roles and account info.

Manage users

🔥 SuperTokens vs others

Please find a detailed comparison chart on our website

🛠️ Building from source

Please see our wiki for instructions.

👥 Community

If you think this is a project you could use in the future, please :star2: this repository!

Contributors (across all SuperTokens repositories)

Rishabh Poddar Advait Ruia Bhumil Sarvaiya Joel Coutinho
Rakesh UP Mufassir Kazi Nemi Shah Rohit Bhatia
Madhu Mahadevan Aidar Nugmanoff Arnav Dewan NkxxkN
LordChadiwala Luiz Soares Sudipto Ghosh Fabricio20
metallicmonkey Vidhyanshu Jain Domenico Luciani Enzo Batrov
Eloïse Isautier Ákos Resch Chotu Chaudhary Tomáš Horáček
Sam Bauch Alexey Tylindus Gus Fune

Extension points exported contracts — how you extend this code

TestingProcess (Interface)
(no doc) [4 implementers]
src/test/java/io/supertokens/test/TestingProcessManager.java
ResultSetValueExtractor (Interface)
(no doc) [2 implementers]
src/main/java/io/supertokens/inmemorydb/ResultSetValueExtractor.java
ProcessConsumer (Interface)
(no doc)
ee/src/test/java/io/supertokens/ee/test/ProcessConsumer.java
LoginMethod (Interface)
(no doc)
stress-tests/src/oneMillionUsers/generateUsers.ts
TestFunction (Interface)
(no doc)
src/test/java/io/supertokens/test/Utils.java
EEFeatureFlagInterface (Interface)
(no doc) [1 implementers]
src/main/java/io/supertokens/featureflag/EEFeatureFlagInterface.java
User (Interface)
(no doc)
stress-tests/src/oneMillionUsers/generateUsers.ts
ProcessConsumer (Interface)
(no doc)
src/test/java/io/supertokens/test/ProcessConsumer.java

Core symbols most depended-on inside this repo

getProcess
called by 9405
src/test/java/io/supertokens/test/TestingProcessManager.java
get
called by 7659
src/main/java/io/supertokens/utils/SemVer.java
checkOrWaitForEvent
called by 3558
src/test/java/io/supertokens/test/TestingProcessManager.java
getStorage
called by 2125
src/main/java/io/supertokens/storageLayer/StorageLayer.java
kill
called by 1712
src/test/java/io/supertokens/test/TestingProcessManager.java
getType
called by 1480
src/main/java/io/supertokens/inmemorydb/Start.java
getAppForTesting
called by 759
src/test/java/io/supertokens/test/TestingProcessManager.java
getConfig
called by 624
src/main/java/io/supertokens/inmemorydb/config/Config.java

Shape

Method 6,119
Class 886
Function 75
Enum 15
Interface 13

Languages

Java99%
TypeScript1%

Modules by API surface

src/main/java/io/supertokens/inmemorydb/Start.java269 symbols
src/test/java/io/supertokens/test/CronjobTest.java71 symbols
src/main/java/io/supertokens/inmemorydb/queries/PasswordlessQueries.java68 symbols
src/main/java/io/supertokens/inmemorydb/queries/GeneralQueries.java65 symbols
src/main/java/io/supertokens/config/CoreConfig.java64 symbols
src/test/java/io/supertokens/test/accountlinking/MultitenantTest.java58 symbols
src/main/java/io/supertokens/inmemorydb/config/SQLiteConfig.java50 symbols
src/main/java/io/supertokens/inmemorydb/queries/WebAuthNQueries.java49 symbols
src/main/java/io/supertokens/authRecipe/AuthRecipe.java46 symbols
src/test/java/io/supertokens/test/multitenant/api/TestMultitenancyAPIHelper.java45 symbols
src/main/java/io/supertokens/inmemorydb/ConnectionWithLocks.java45 symbols
src/main/java/io/supertokens/webserver/WebserverAPI.java44 symbols

Dependencies from manifests, versioned

@testing-library/jest-dom5.17.0 · 1×
@testing-library/react13.4.0 · 1×
@testing-library/user-event13.5.0 · 1×
@types/node20.11.24 · 1×
@types/uuid10.0.0 · 1×
deepcopy2.1.0 · 1×
knex3.0.1 · 1×
libphonenumber-js1.10.49 · 1×
mysql23.6.3 · 1×
pg8.11.3 · 1×
prettier3.5.3 · 1×
react18.3.1 · 1×

Datastores touched

(mongodb)Database · 1 repos
(mysql)Database · 1 repos
randomDatabase · 1 repos
randomDatabase · 1 repos
supertokensDatabase · 1 repos

For agents

$ claude mcp add supertokens-core \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact