WRDAuthPlugin (open)
WRD auth webdesign plugin
Syntax
LOADLIB "mod::wrd/lib/internal/auth/webdesignplugin.whlib";
OBJECTTYPE WRDAuthPlugin
Variables
- STRING ARRAY cachefields
WRD fields to export to JS when no support object is configured
Properties
- PROPERTY accounttype
Account type
- PROPERTY authpageswitty
Resource with the Witty for the authentication pages
- PROPERTY entityid
Entity ID of the currently logged in user
- PROPERTY routerfeatures
Router features
- PROPERTY sessionexpires
Returns when the current session expires
- PROPERTY userapi
WRD user api
- PROPERTY webcontext
Current webcontext/webdesign
- PROPERTY wrdschema
WRD schema
Functions
- MACRO CheckNotFailed()
Checks whether configuration of the plugin is successfull, throws if this is not the case
- RECORD FUNCTION CheckPasswordUpdate(INTEGER entityid, STRING newpassword)
- MACRO ConfigurePlugin(OBJECT webdesign, RECORD config)
Used for configuring the plugin
- RECORD FUNCTION CreatePasswordResetLink(STRING baseurl, INTEGER entityid, RECORD options)
Create a password reset link
- RECORD FUNCTION CreateVerificationLink(STRING baseurl, INTEGER entityid, RECORD options)
Creates a link that can be used to verify a user is present at a account page
- RECORD FUNCTION ExecutePasswordReset(STRING _ed, STRING verifier, STRING newpassword, RECORD options)
- RECORD FUNCTION ExecutePasswordSet(STRING newpassword, RECORD options)
- RECORD FUNCTION FinalizeBeforeRendering(OBJECT webdesign, RECORD pageconfig)
- RECORD FUNCTION GenerateLoginRequest(STRING type, STRING serviceprovidertag, STRING redirectto, RECORD options)
Generate a SAML SSO or OIDC authentication request
- RECORD FUNCTION GenerateSAMLLoginRequest(STRING serviceprovidertag, STRING redirectto, RECORD options)
Generate a SAML authentication request
- RECORD FUNCTION GenerateSetupSecondFactorLink(STRING baseurl, INTEGER entityid)
Generate a link to setup the second factor of an account
- OBJECT FUNCTION GetCurrentWebhareUser()
Get the currently loggedin WebHare user
- STRING FUNCTION GetFailReason()
Returns the text with a configuration error
- INTEGER FUNCTION GetLoggedinEntity()
Returns the WRD id of the currently logged in entity
- RECORD FUNCTION GetLoggedinEntityFields(STRING ARRAY fields)
Returns WRD fields of the currently logged in entity
- STRING FUNCTION GetLogoutLink()
Returns a link that logs out the user and then returns to the current page
- OBJECT FUNCTION GetSAMLIDPConfig()
Returns the configuration object for the SAML IDP for this schema
- OBJECT FUNCTION GetSAMLSPConfig(STRING sptag)
Returns the configuration object for a registered SAML SP
- OBJECT FUNCTION GetSupportObject()
Get (cached) support object
- RECORD FUNCTION GetUserEditPolicyForUser(INTEGER user, RECORD options)
Returns the user edit policy for a user
- RECORD FUNCTION GetUserInfo()
Get user info. This info is stored in the cookies, so available to JS.
- RECORD FUNCTION GetWittyData()
- RECORD FUNCTION GetWRDAuthRouterWittyData(STRING baseurl)
Get links for a wrdauth router
- MACRO HandleForgotPassword(STRING email, RECORD options)
Handles requesting a password reset link for a forgotten password. Sends an e-mail if a user with his email address is known.
- BOOLEAN FUNCTION HasFailed()
Returns whether configuration of the plugin has failed
- RECORD ARRAY FUNCTION HookGetDebugSettings() (inherited from WebDesignPluginBase)
- MACRO HookObjectProps(OBJECT objectpropsapi) (inherited from WebDesignPluginBase)
- RECORD FUNCTION HookPrepareMail() (inherited from WebDesignPluginBase)
Return merge record extensions used by the composer returned by PrepareMailWitty. Enabled by hookfeature 'preparemail'.
- RECORD FUNCTION InitiateSAMLIdPInitiatedLogin(STRING spentityid)
Initiates a SAML initiated login. Looks up the SAML IdP endpoint file in the current site and lets that file start the flow for the currently logged in user
- BOOLEAN FUNCTION IsLoggedIn()
Returns whether a user is currently logged in
- BOOLEAN FUNCTION IsLogoutAllowed()
Check whether the current user can be logged out
- STRING ARRAY FUNCTION ListConfigurationNodeAttributes(OBJECT node) (inherited from WebDesignPluginBase)
Explain which attributes are set for the configuration node (ie, which attributes a later webdesignplugin node overrides. By default, returns the names of all attributes
- MACRO LogCustomAuditEvent(STRING type, RECORD options)
Log a custom audit event
- RECORD FUNCTION Login(STRING loginname, STRING password, RECORD options)
Logs in a user by password
- RECORD FUNCTION LoginById(INTEGER userid, BOOLEAN is_impersonation, RECORD options)
Logs in a user by ID
- RECORD FUNCTION LoginSecondFactor(STRING loginproof, STRING type, RECORD data, RECORD options)
Logs in a user by password
- MACRO Logout(RECORD options)
Log the user out.
- INTEGER FUNCTION LookupLogin(STRING loginname)
Lookup a user by login name
- MACRO MarkVerificationLinkUsed(INTEGER entityid, RECORD verificationresult)
Marks a verification link as used
- RECORD FUNCTION ParseAuthLoginProof()
Parses login proof
- RECORD FUNCTION ParseConfigurationNode(OBJECT siteprofile, OBJECT node)
Used for parsing plugin configuration data
- OBJECT FUNCTION PrepareAuthPageMail(STRING component)
Prepares an authpage e-mail
- MACRO PrepareForRendering(OBJECT webdesign)
Prepares this plugin for rendering
- MACRO ProcessReturnTo(STRING logincontroltoken)
Handles a return to an original page
- RECORD FUNCTION ProcessSetupSecondFactorLink(STRING encrypted_data)
Processes a two factor setup link, checks if it is valid
- RECORD FUNCTION ProcessVerificationLink(STRING encrypted_data, STRING verifier)
Processes a verification link and the passed verification code, checks if they are valid
- OBJECT FUNCTION RequireExternalLoggedinUser()
Verify that the user is logged in on the plugin, which may not actually cover the current URL
- OBJECT FUNCTION RequireLoggedInUser()
Verify that the user is logged in, letting him login if he isn't yet
- BOOLEAN FUNCTION RequireRight(STRING right)
Verify that the user has the specified right. Let the user log in if he isn't yet
- BOOLEAN FUNCTION RequireRightOn(STRING right, INTEGER obj)
Verify that the user has the specified right on a specific object. Let the user log in if he isn't yet
- MACRO UpdateCurrentUserPassword(STRING newpassword, RECORD options)
Change the loggedin user's password. We expect the caller to handle our transaction
- MACRO UpdateUserInfo()
Update user info (updates the javascript cookie holding the userinfo fields)
- MACRO UpdateUserPassword(INTEGER userid, STRING newpassword, RECORD options)
Set the password for a user
- BOOLEAN FUNCTION VerifyCurrentPassword(STRING currentpwd)
Verify the specified password for the current user
- RECORD FUNCTION _GetConfig()
Return the configuration