I’m using form authentication on tomcat with orbeon. I can display user credentials on a specific page (I adapted the java-authentication sample). I also implemented a logout link on all pages using a custom theme (it’s a simple href to /authentication/logout).
I wonder if there is a simple way to display something like “You are logged as USERNAME (ROLE)” on the page banner using my custom theme ?
You would do this in the theme, which is in XSLT:
xxf:get-remote-user(). But the theme XSLT runs after XForms processing, so you can’t use XForms there. Instead, you would need to call Java code, that you call from XSLT:org.orbeon.oxf.util.NetUtils.getExternalContext().getRequest().getRemoteUser().isUserInRole(), which you would call similarly to thegetRemoteUser()of point 2.