Skip to content

passageidentity/passage-python

Repository files navigation

Passage logo

PyPI version

passage-python

This Python SDK allows for verification of server-side authentication for applications using Passage

Install this package using pip.

pip install passage-identity

Instantiating the Passage Class

Passage has three arguments that can be used for initialization: app_id, api_key, and auth_strategy.

  • app_id is the Passage App ID that specifies which app should be authorized. It has no default value and must to be set upon initialization.
  • api_key is an API key for the Passage app, which can be generated in the 'App Settings' section of the Passage Console. It is an optional parameter and not required for authenticating requests. It is required to get or update user information.
  • Deprecated auth_strategy defines where the Passage SDK should look for the authentication token. It is set by default to Passage.COOKIE_AUTH, but can be changed to Passage.HEADER_AUTH.
from passageidentity import Passage
import os

PASSAGE_APP_ID = os.environ.get("PASSAGE_APP_ID")
PASSAGE_API_KEY = os.environ.get("PASSAGE_API_KEY")

psg = Passage(PASSAGE_APP_ID, PASSAGE_API_KEY)

Available Functions

Method Description
activateUser Activate User
deactivateUser Deactivate User
deleteUser Delete User
deleteUserDevice Delete User Device
authenticateRequest Validates user jwt token
createMagicLink Create Embeddable Magic Link
createUser Create User
deleteUserDevice Delete a device for a user
getApp Get App
getUser Get User
getUserByIdentifier Get User By Identifier
listUserDevices List User Devices
revokeUserDevice Deprecated Delete User Device
revokeUserRefreshTokens Signout User
signOut Deprecated Signout User
updateUser Update User
validateJwt Validates user jwt token