You can access the value of the securityStatus
property in any content page (JSP or .JHTML file). For example, in JSP code you could display the value using a dsp:valueof
tag:
<dsp:valueof bean="/atg/userprofiling/Profile.securityStatus"/>
In JHTML:
<valueof bean="/atg/userprofiling/Profile.securityStatus"></valueof>
In actual use, you will typically want to compare the value of securityStatus
to some minimum security level. The /atg/userprofiling/PropertyManager
component has seven properties that correspond to the levels of securityStatus
:
securityStatusAnonymous
securityStatusUrl
securityStatusCookie
securityStatusBasicAuth
securityStatusLogin
securityStatusSecureLogin
securityStatusCertificate
For example, the PropertyManager.securityStatusLogin
property has a default value of 4, which is the value that Profile.securityStatus
is set to if the user logs in manually under http protocol.
The following JSP example illustrates a typical use of securityStatus
. The Compare
servlet bean compares the value of securityStatus
to the value of the securityStatusLogin
property of the PropertyManager
component. If the value of securityStatus
is less than the value of securityStatusLogin
, the user did not log in manually, so a login form is displayed. If the value of securityStatus
is greater than or equal to the value of securityStatusLogin
, the user has already manually logged in, so the requested content is displayed.
<dsp:droplet name="Compare"> <dsp:param bean="Profile.securityStatus" name="obj1"/> <dsp:param bean="PropertyManager.securityStatusLogin" name="obj2"/> <dsp:oparam name="lessthan"> <!-- send the user to the login form --> <dsp:include page="login_form.jsp"></dsp:include> </dsp:oparam> <dsp:oparam name="default"> <!-- allow the user to proceed to the protected content --> <dsp:include page="protected_content.jsp"></dsp:include> </dsp:oparam> </dsp:droplet>
Here is the same example in JHTML:
<droplet bean="Compare"> <param name="obj1" value="bean:Profile.securityStatus"> <param name="obj2" value="bean:PropertyManager.securityStatusLogin"> <oparam name="lessthan"> <!-- send the user to the login form --> <droplet src="login_form.jhtml"></droplet> </oparam> <oparam name="default"> <!-- allow the user to proceed to the protected content --> <droplet src="protected_content.jhtml"></droplet> </oparam> </droplet>