Skip to content

Latest commit

 

History

History
1317 lines (1068 loc) · 40.8 KB

project.md

File metadata and controls

1317 lines (1068 loc) · 40.8 KB

lib_UserManager

User management and Authentication for your projects

The lib_UserManager enables your projects to include user management and authentication in your apps. This library will handle :

  • user login with user/password using a salted password security
  • user login using OpenID (Google, Azure & linkedin)

When using user/password, the library will use the lib_usermanager_fullsync database to store userids and salted/hashed password

Symbols :

symbol Usage
lib_UserManager.adminPassword.secret LDAP admin account password
lib_UserManager.adminUser LDAP admin account user
lib_UserManager.ldapBasePath LDAP Search Root Path
lib_UserManager.ldapDomainName LDAP DOMAIN Name
lib_UserManager.ldapServer LDAP server address:port
lib_UserManager.smtp.server SMTP server address
lib_UserManager.smtp.port SMTP server port
lib_UserManager.smtp.sauthtype SMTP server authentication type
lib_UserManager.smtp.sender SMTP sender mail address
lib_UserManager.smtp.user SMTP server user account
lib_UserManager.smtp.password.secret SMTP server password
References

CouchDb_schema

CouchDb_schema

see documentation

lib_FullSyncGrp

lib_FullSyncGrp

see readme

lib_OAuth

lib_OAuth

see readme

Connectors

lib_usermanager_fullsync

Transactions

DeleteDocument

DeleteDocument

Variables

name comment
RequestableVariable _use_docid

GetAccountDocument

GetAccountDocument

Variables

name comment
RequestableVariable _use_docid

GetServerInfo

GetServerInfo

GetView

GetView

Variables

name comment
RequestableVariable _use_ddoc
RequestableVariable _use_descending
RequestableVariable _use_endkey
RequestableVariable _use_key
RequestableVariable _use_startkey
RequestableVariable _use_view

PostDocument

PostDocument

Variables

name comment
RequestableVariable _id
RequestableVariable _use_json_base
RequestableVariable data

PostMergeDocument

PostMergeDocument

Variables

name comment
RequestableVariable _id
RequestableVariable _use_json_base
RequestableVariable _use_merge

Sequences

AddUser : Adds an user to the Internal Convertigo User database

AddUser

Adds an user to the Internal Convertigo User database

Variables

name comment
RequestableVariable askForPasswordReset The user id as a valid email address
RequestableVariable emailBody Email content
RequestableVariable emailLogo Email logo to be added
RequestableVariable emailSubject Email subject
RequestableVariable password The inital password. (User will be able to change it afterwards)
RequestableVariable targetApplicationName Email where to send the reset password link to
RequestableVariable user The user id as a valid email address

CheckSecureToken : The `CheckSecureToken` sequence verifies the validity of a JWT by checking its structure, expiration, and signature

CheckSecureToken

The CheckSecureToken sequence verifies the validity of a JWT by checking its structure, expiration, and signature. It extracts the payload, validates the password hash, and manages associated JWT tokens for the user. Additionally, it refreshes the JWT token.

Variables

name comment
RequestableVariable token

ConfirmAccount : Confirms a user account if a passwordResetKey was provided, or sends an email to the user with a passwordResetKey and allow him to confirm account

ConfirmAccount

Confirms a user account if a passwordResetKey was provided, or sends an email to the user with a passwordResetKey and allow him to confirm account. It should be called by CreateAccount sequence.

Variables

name comment
RequestableVariable email Email where to send the reset password link to
RequestableVariable emailLogo Email logo to be added
RequestableVariable emailSubject Email subject
RequestableVariable lang The lang to be used in the email. It can be fr or en
RequestableVariable passwordResetKey Password reset key (Optional)
RequestableVariable targetApplicationName The Target application name to be used into the email template

CreateAccount : Creates a user account and sends validation email, to active this account

CreateAccount

Creates a user account and sends validation email, to active this account

Variables

name comment
RequestableVariable emailLogo Email logo to be added
RequestableVariable emailSubject Email subject
RequestableVariable lang The language to be used into the email. Can be fr or en.
RequestableVariable password The inital password. (User will be able to change it afterwards)
RequestableVariable targetApplicationName target Application Name
RequestableVariable user The user id as a valid email address

DeleteUser : Deletes an user from the internal Convertigo database

DeleteUser

Deletes an user from the internal Convertigo database

Variables

name comment
RequestableVariable user The user ID as (The users email address)

ForgotPassword : Has to be called with email fields not empty to send an email reset link to the user, or with a newPassword an passwordResetKey not empty to excplicitly reset a password

ForgotPassword

Has to be called with email fields not empty to send an email reset link to the user, or with a newPassword an passwordResetKey not empty to excplicitly reset a password

Variables

name comment
RequestableVariable email Email where to send the reset password link to
RequestableVariable emailBody Email content
RequestableVariable emailLogo Email logo to be added
RequestableVariable emailSubject Email subject
RequestableVariable newPassword New password to be set
RequestableVariable passwordResetKey Password reset key
RequestableVariable targetApplicationName Email where to send the reset password link to

ForgotPasswordWithBrand : Has to be called with email fields not empty to send an email reset link to the user, or with a newPassword an passwordResetKey not empty to excplicitly reset a password

ForgotPasswordWithBrand

Has to be called with email fields not empty to send an email reset link to the user, or with a newPassword an passwordResetKey not empty to excplicitly reset a password

Variables

name comment
RequestableVariable email Email where to send the reset password link to
RequestableVariable emailLogo Email logo to be added
RequestableVariable emailSubject Email subject
RequestableVariable lang The lang to be used in the email. It can be fr or en
RequestableVariable newPassword New password to be set
RequestableVariable passwordResetKey Password reset key
RequestableVariable targetApplicationName The Target application name to be used into the email template

GenerateSecureToken : The `GenerateSecureToken` sequence creates a JWT token with a specified expiration and includes a password hash in the payload

GenerateSecureToken

The GenerateSecureToken sequence creates a JWT token with a specified expiration and includes a password hash in the payload. It encodes the token using HMAC SHA256 and appends it to the user's document, managing JWT tokens for secure user authentication.

Variables

name comment
RequestableVariable passwordHash
RequestableVariable tokenExpiration
RequestableVariable userName

GetUAllserAttributes : Gets a given attribute from an user account

GetUAllserAttributes

Gets a given attribute from an user account

Variables

name comment
RequestableVariable attribute The attribute name
RequestableVariable user The user where we have to get the attribute from

GetUserAttribute : Gets a given attribute from an user account

GetUserAttribute

Gets a given attribute from an user account

Variables

name comment
RequestableVariable attribute The attribute name
RequestableVariable user The user where we have to get the attribute from

GetUserByAttributeNameAndValue : Gets an user by attribute name and value

GetUserByAttributeNameAndValue

Gets an user by attribute name and value

Variables

name comment
RequestableVariable attrName
RequestableVariable attrValue

HashAndSalt : Utility sequence to Hash and Salt passwords

HashAndSalt

Utility sequence to Hash and Salt passwords

Variables

name comment
RequestableVariable hash
RequestableVariable password
RequestableVariable salt

ListUsers : Lists users from the internal Convertigo User database

ListUsers

Lists users from the internal Convertigo User database

ModifyPassword : Modify a password for a given user

ModifyPassword

Modify a password for a given user

Variables

name comment
RequestableVariable password New password to be set
RequestableVariable user User email to set the new password on

RemoveDraftedAccounts : Remove any drafts accounts not confirmed by email

RemoveDraftedAccounts

Remove any drafts accounts not confirmed by email. Has to be scheduled.

Variables

name comment
RequestableVariable doDelete Perform effectively deletions operations if true
RequestableVariable hours Any account aged more than this number of hours, will be deleted.

SetUserAttribute : Sets a given attribute on an user account if the account doesn't exists, an account will be created with a fake radom password

SetUserAttribute

Sets a given attribute on an user account if the account doesn't exists, an account will be created with a fake radom password

Variables

name comment
RequestableVariable attribute The attribute name
RequestableVariable user The user where we have to set the attribute on
RequestableVariable value The attribute value

SignIn : Performs a user sign in for a given user with its id (email) and password

SignIn

Performs a user sign in for a given user with its id (email) and password

Variables

name comment
RequestableVariable password The user's password
RequestableVariable rememberMe Stay logged in for an extended period, even after closing the browser
RequestableVariable user The userID (user's email)

SignInAD : Sign in using an ActiveDirectory account

SignInAD

Sign in using an ActiveDirectory account. Will also return the list of groups the user belongs to

Variables

name comment
RequestableVariable adminPassword The Active Directory admin account password. If not provided or invalid, the group membership information will not be provided.
RequestableVariable adminUser A valid ActiveDirectory Admin Account with read privileges used to search for the user attributes. If this is not provided, the group membership information will not be returned.
RequestableVariable domainNameUser
RequestableVariable ldapBasePath The active directory user user to sign in. May be a valid domain account ex: 'DOMAIN\user' or the user's email ex: 'user@domain.com' or just the users full name ex: 'John doe'
RequestableVariable ldapServer The Active Directory server ldap url as ldap(s)://server:port. Mandatory.
RequestableVariable password The users password
RequestableVariable user The active directory user user to sign in. May be a valid domain account ex: 'DOMAIN\user' or the user's email ex: 'user@domain.com' or just the users full name ex: 'John doe'

SignInADBulk : Sign in using an ActiveDirectory account

SignInADBulk

Sign in using an ActiveDirectory account. Will also return the list of groups the user belongs to

Variables

name comment
RequestableVariable adminPassword The Active Directory admin account password. If not provided or invalid, the group membership information will not be provided.
RequestableVariable adminUser A valid ActiveDirectory Admin Account with read privileges used to search for the user attributes. If this is not provided, the group membership information will not be returned.
RequestableVariable domainNameUser
RequestableVariable ldapBasePath The active directory user user to sign in. May be a valid domain account ex: 'DOMAIN\user' or the user's email ex: 'user@domain.com' or just the users full name ex: 'John doe'
RequestableVariable ldapServer The Active Directory server ldap url as ldap(s)://server:port. Mandatory.
RequestableVariable password The users password
RequestableVariable user The active directory user user to sign in. May be a valid domain account ex: 'DOMAIN\user' or the user's email ex: 'user@domain.com' or just the users full name ex: 'John doe'

SignInAdPostGroups

SignInAdPostGroups

SignOut : The `SignOut` sequence logs out the authenticated user by removing their associated JWT token from the user's document and clearing the authenticated user session

SignOut

The SignOut sequence logs out the authenticated user by removing their associated JWT token from the user's document and clearing the authenticated user session.

Variables

name comment
RequestableVariable token