I think I understand the separation between Orbeon and container based authentication a little better now. And though I think it would be handy, I think this separation must be why Orbeon doesn't have built in capabilities of displaying the logged in user and enabling logout. I'm attempting to implement these things now. I would love some feedback on my method. This is what I'm doing:
First, I created a logout.jsp file in the root of the Orbeon war directory. For simplicity of testing I have hardcoded a redirect URL. After accessing this page, and then attempting to access a protected page, I am prompted to authenticate. Is this sufficient? Would someone with better knowledge of best practices do this differently?
Aaron Spike This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Hi Aaron, The way you're doing the logout looks good to me. And based on the discussion on Twitter, which I imagine happened after this post, using p:get-remote-user() is working for you, correct? Alex On Tue, Mar 24, 2015 at 1:02 PM Aaron Spike <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Yes, p:get-remote-user() works fabulously.
Can you comment on the syntax for making calls to Java from XSL? I know I can do: <xsl:value-of xmlns:utils="java:org.orbeon.oxf.util.NetUtils" select="utils:getExternalContext()"/> But I don't see how it is possible to follow this with getRequest() and then getRemoteUser()? Is is possible or must anything requiring a chain of calls like this be rolled into a helper method on a Java class somewhere to call as a unit? Aaron Spike This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Administrator
|
Hi Aaron, Yes, it is possible, with code along the lines of: <xsl:variable name="externalContext" xmlns:utils="java:org.orbeon.oxf.util.NetUtils" select="utils:getExternalContext()"/> <xsl:variable name="username" xmlns:ec="java:org.orbeon.oxf.pipeline.api.ExternalContext" select="ec:getUsername(externalContext)"/> But as you can see, it is a pain to write: the code is extremely verbose, you have no indication on whether your code is correct until you run it, and errors can be cryptic. So you'll find pretty quickly that you're better off writing a static method somewhere that does all the calls you need, so you can call it directly. Alex On Fri, Mar 27, 2015 at 5:34 AM Aaron Spike <[hidden email]> wrote:
You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email].
--
Follow Orbeon on Twitter: @orbeon Follow me on Twitter: @avernet |
Thanks for the very helpful example.
Aaron Spike This electronic communication, including any attached documents, may contain confidential and/or legally privileged information that is intended only for use by the recipient(s) named above. If you have received this communication in error, please notify the sender immediately and delete the communication and any attachments. Views expressed by the author do not necessarily represent those of Martin Luther College. -- You received this message because you are subscribed to the Google Groups "Orbeon Forms" group. To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]. To post to this group, send email to [hidden email]. |
Free forum by Nabble | Edit this page |