DigiD vipers
DigiD Vipers
This article describes the available DigiD vipers.
digid.currentlevel
Gets the DigiD security code ("betrouwbaarheidsniveau") for the current user. Returns 0 if the current user doesn't have an active/valid DigiD session.
digid.useridentifier
Gets the DigiD user identifier ("BSN") for the current user. Returns null if the current user doesn't have an active/valid DigiD session.
digid.isvalid
Checks whether the current user has an active/valid DigiD session. If that's the case true is returned, otherwise false.
The three vipers mentioned above will all check if session state has been enabled for the current item. If not, an SessionStateNotEnabled exception will be thrown. If you do not want the automatic session check to execute, each of these vipers provide an overload with a checksession parameter, which can be used to disable the automatic session check. However, disabling the session check should only be used within rendertemplates or translations used within rendertemplates.
digid.logoff
Logs off the current user and ends the DigiD session. If the impersonate attribute of the DigiD macro has been set to true, in which case forms authentication is used to remember the user, a sign-out for forms authentication is called as well.
Smartsite SXML | Copy Code |
---|---|
{session.enable()} {sys.iif(request.query(forcelogoff)==1, digid.logoff())} {buffer.set(digidid, digid.useridentifier(default=''))} {sys.iif(string.isempty($digidid) AND request.query(forcelogon)==1, digid.redirecttologin(DIGID_LOGIN, url.removeparameter(request.location(), 'forcelogon')) )} {sys.iif(string.isempty($digidid), '(Niet ingelogd) - '+html.link(url.addparameter(itemdata.number(), 'forcelogon',1),'Inloggen'), $digidid+' - '+html.link(url.addparameter(itemdata.number(), 'forcelogoff',1),'Uitloggen') )} |
digid.redirecttologin
Viper which makes it easier to create a redirect to the DigiD login page. It automatically sets the current location as return url. It also recognizes DigiD-specific querystring variables, in which case the redirect will be aborted.
Smartsite SXML | Copy Code |
---|---|
{sys.iif(security.contentaccess.getaccesslevel('digidaccess') GT digid.currentlevel(false), digid.redirecttologin(DIGID_LOGIN) )} |