SDKs

Authenticate requests and manage users in your backend application.

Passage provides backend libraries to simplify the entire process of user management. There are two main use cases for a backend library:

  1. Authenticating Requests

  2. Managing Passage Users

Authenticating Requests

Passage serves as your identity provider (IDP) by storing all of your app's users and authentication material. With a Passage Element, users obtain an authentication token from Passage before making subsequent requests to your web server. When a user makes an authenticated request, it is your web server's responsibility to ensure that the request is properly authenticated. Passage backend libraries make it easy. Examples of using a Passage backend library to authenticate an HTTP request are shown below:

import (
	"net/http"

	"github.com/passageidentity/passage-go"
)

func exampleHandler(w http.ResponseWriter, r *http.Request) {

	// Authenticate this request using the Passage SDK:
	psg, _ := passage.New("<PASSAGE_APP_ID>", nil)
	_, err := psg.AuthenticateRequest(r)
	if err != nil {
		// 🚨 Authentication failed!
		w.WriteHeader(http.StatusUnauthorized)
		return
	}

	// ✅ Authentication successful. Proceed...

}

Managing Passage Users

Passage backend libraries can be used to manage and query Passage users. You can use these functions to get information about a user, update a user's email, and activate or deactivate a user. Please see the specific SDK reference pages to learn about the language-specific interfaces for user management functionality.

In addition to your App ID, managing users requires authentication to Passage in the form of an API key. This ensure that only your application has access to information about your users. You can generate and manage your API keys in the App Settings in the Passage Console. Go there now.

Libraries

pageGopageNode.jspagePHPpagePythonpageRuby

Last updated