Introduction - SuperTokens Docs

Introduction

Authenticate microservices using SuperTokens with the OAuth2 Client Credentials Flow.

Implement OAuth2 client-credentials authentication for services.

Implement SuperTokens machine-to-machine authentication for this repository. Inspect the services, backend SDK, deployment model, and existing secrets configuration first. Prefer the managed-service OAuth2 client-credentials flow when supported; otherwise explain the legacy-flow tradeoff. Configure the OAuth2 provider, clients, token acquisition, service authentication, scopes, and secret storage without committing credentials. Validate token issuance, expiry, invalid credentials, and protected service-to-service requests.

Overview

The recommended way to authenticate microservices with SuperTokens is by using the OAuth2 specification. You have to create an OAuth2 Provider and use the OAuth2 Client Credentials Flow for authorization.

Prerequisites

This feature is only available to paid users. Follow the instructions below to enable it.

This feature is available only with the SuperTokens Managed Service.

Managed Service

  1. Sign in to the SuperTokens dashboard.
  2. Select the managed service option from the service type select component.
  3. Select your core instance from the next element or create a new one.
  4. Open Features sub-page and enable the required ones.

Before you can dive deeper in the functionality there are a few things to keep in mind:

If you do not meet the previous requirements you can use the legacy flow.

Getting started

Two separate quickstart guides are available for you to follow. The recommendation is to use the Client Credentials Flow. The Legacy Flow guide is here for backwards compatibility and it is going to be deprecated in the future.

Before you explore a guide, read through the OAuth2 Basics page first. It explains concepts used in each tutorial.

[OAuth2 Basics
Go through a quick summary of the OAuth2 specifications to get accustomed with the language used in the quickstart guides.](/content/docs/authentication/unified-login/oauth2-basics/index.html) [Client Credentials Flow

Implement a common authentication service that all your microservices can use.](/content/docs/authentication/m2m/client-credentials/index.html) [Legacy Flow

Legacy info](/content/docs/authentication/m2m/legacy-flow/index.html)