You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by wami99 <wa...@googlemail.com> on 2012/07/25 15:55:59 UTC

Getting Java Applet same authentication as browser session

In a web-app when authenication is done in a browser, everything works fine.
But when a Java Applet comes in to play, it redirects to the login page.
What would be the best solution if there are some applets which can run in
parallel. How can I provide every new Thread from the same host with the
previous given credentials.
For any help many thanks in advance.

Walter






--
View this message in context: http://shiro-user.582556.n2.nabble.com/Getting-Java-Applet-same-authentication-as-browser-session-tp7577632.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Getting Java Applet same authentication as browser session

Posted by Les Hazlewood <lh...@apache.org>.
If I understand your question correctly, I think our spring sample app
demonstrates what you desire:

http://svn.apache.org/repos/asf/shiro/trunk/samples/spring/

The basic idea is that web app's session ID must be passed in as an
init param to the applet (or Java Web Start application).  The applet
or JWS app will send the session id with every request and the server
side remoting endpoint must get the session ID, create a subject
instance based on the Session ID, bind it to the thread, execute the
invocation, and then clean the thread.

This kind of logic is shown here for a Spring-specific remote
invocation, but the concept works the same for any environment:

http://svn.apache.org/repos/asf/shiro/trunk/support/spring/src/main/java/org/apache/shiro/spring/remoting/SecureRemoteInvocationExecutor.java

HTH!

--
Les Hazlewood | @lhazlewood
CTO, Stormpath | http://stormpath.com | @goStormpath | 888.391.5282
Stormpath wins GigaOM Structure Launchpad Award! http://bit.ly/MvZkMk

On Wed, Jul 25, 2012 at 6:55 AM, wami99 <wa...@googlemail.com> wrote:
> In a web-app when authenication is done in a browser, everything works fine.
> But when a Java Applet comes in to play, it redirects to the login page.
> What would be the best solution if there are some applets which can run in
> parallel. How can I provide every new Thread from the same host with the
> previous given credentials.
> For any help many thanks in advance.
>
> Walter
>
>
>
>
>
>
> --
> View this message in context: http://shiro-user.582556.n2.nabble.com/Getting-Java-Applet-same-authentication-as-browser-session-tp7577632.html
> Sent from the Shiro User mailing list archive at Nabble.com.