[ 
https://issues.apache.org/jira/browse/ISIS-415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13670258#comment-13670258
 ] 

Christian Steinebach commented on ISIS-415:
-------------------------------------------

Hi Martin!

It would be a bit like the LogonAsSvenFixture. Probably not a good idea for a 
production system, but useful for testing.
And I need to cook up something until the end of the weekend. :-(
My real problem is where to do the automatic login in Isis. I've overridden 
newSession() (see below) and
done several other trials (and always errors ... :-(  ) I thought it should be 
possible, but I'm lost in the forest
of interdependencies of wicket, isis, my lack of understanding how things are 
connected etc...
Dan asked me to issue a ticket on it. 

         Regards
             Christian


public class TransportPlannerApplication extends IsisWicketApplication {

    @Override
    public Session newSession(Request request, Response response) {

        Session session = super.newSession(request, response);
        IAuthenticationStrategy authenticationStrategy = 
getSecuritySettings().getAuthenticationStrategy();
        
            StringValue user = null;
            StringValue password = null;

            user = request.getRequestParameters().getParameterValue("user");
            password = 
request.getRequestParameters().getParameterValue("password");

        if (user != null)
            authenticationStrategy.save(user.toString(), "pass");
        else
            authenticationStrategy.save("sven", "pass");
        
        
        ((AuthenticatedWebSessionForIsis) 
session).getAuthenticationSession().authenticate(user.toString(), 
password.toString);
        return session;
    }




                
> Automatic login through parameters in the url
> ---------------------------------------------
>
>                 Key: ISIS-415
>                 URL: https://issues.apache.org/jira/browse/ISIS-415
>             Project: Isis
>          Issue Type: New Feature
>          Components: Viewer: Wicket
>            Reporter: Christian Steinebach
>            Assignee: Dan Haywood
>              Labels: login, loginmodule
>
> It would be useful to be able to login by specifying user/password in the URL
> Example:
> http://localhost:8080/MyIsisApplication?user=sven&password=pass
> The application will then automatically try to login as user sven

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to