users@glassfish.java.net
ProgrammaticLogin - get Subject on client side - how?
This message
: [
Message body
] [ More options (
top
,
bottom
) ]
Related messages
: [
Next message
] [
Previous message
] [
Next in thread
] [
Replies
]
Contemporary messages sorted
: [
by date
] [
by thread
] [
by subject
] [
by author
] [
by messages with attachments
]
From
: <
glassfish_at_javadesktop.org
>
Date
: Thu, 17 Jul 2008 09:04:42 PDT
The code below is from
http://java.sun.com/javase/6/docs/technotes/guides/security/jaas/JAASRefGuide.html
I understand that you can log in a Java client to the appserver using ProgrammaticLogin, afterwards an EJB is called using the login user.
(
http://docs.sun.com/source/819-0079/dgsecure.html#wp22278
)
But how can you access the authenticated subject to use it for Subject.doAs as in the code below?
Or do you have to use a JAAS CallbackHandler? Is there a suitable on in Glassfish jars?
[code]
public class Example1 {
public static void main(String[] args) {
// Authenticate the subject, "BOB".
// This process is described in the
// LoginContext section.
Subject bob;
// Set bob to the Subject created during the
// authentication process
// perform "ExampleAction" as "BOB"
Subject.doAs(bob, new ExampleAction());
}
}
[/code]
[Message sent by forum member 'weberjn' (weberjn)]
http://forums.java.net/jive/thread.jspa?messageID=287347
This message
: [
Message body
]
Next message
:
Jeanfrancois Arcand: "Re: Using EJBs in CometHandler (GlassFish 2 UR2)"
Previous message
:
Jeanfrancois Arcand: "Re: (mod_jk?) ClientAbortException again."
Next in thread
:
glassfish_at_javadesktop.org: "Re: ProgrammaticLogin - get Subject on client side - how?"
Reply
:
glassfish_at_javadesktop.org: "Re: ProgrammaticLogin - get Subject on client side - how?"
Contemporary messages sorted
: [
by date
] [
by thread
] [
by subject
] [
by author
] [
by messages with attachments
]