@stacks/auth
The @stacks/auth package provides the auth logic used by the @stacks/connect library.
makeAuthRequest
The Stacks authentication process enables secure user sign-in for web apps by generating and handling encrypted authentication requests. It involves setting up an app domain, configuring permissions, and creating a UserSession to manage user data.
Parameters
transitKey
Requiredstring
The authentication payloads are encrypted during transit, the encryption key generated below provides this
redirectURI
Requiredstring
A URL which the authenticator or extension can redirect to with the authentication payload. This page should process the authentication payload.
manifestUri
Requiredstring
Set the location of your app manifest file. This file contains information about your app that is shown to the user during authentication.
scopes
string[]
Additional permissions the app is requesting
UserSession
The Stacks authentication process enables secure user sign-in for web apps by generating and handling encrypted authentication requests. It involves setting up an app domain, configuring permissions, and creating a UserSession to manage user data.
Functions
isSignInPending
function
Determines if there is an incoming authentication response.
handlePendingSignIn
function
Processes the response and provides a userData
object containing the user's identity, BNS username and profile information.
isUserSignedIn
function
Checks if the user is already authenticated.
loadUserData
function
Retrieves the user's profile data if the user is already authenticated.
encryptContent
function
Encrypts user data for secure storage.
decryptContent
function
Decrypts user data for secure storage.
Last updated on