Search in sources :

Example 1 with AuthenticatedWebSessionForIsis

use of org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis in project java-design-patterns by iluwatar.

the class SimpleApplication method newSession.

@Override
public Session newSession(final Request request, final Response response) {
    if (!DEMO_MODE_USING_CREDENTIALS_AS_QUERYARGS) {
        return super.newSession(request, response);
    }
    // else demo mode
    final AuthenticatedWebSessionForIsis s = (AuthenticatedWebSessionForIsis) super.newSession(request, response);
    IRequestParameters requestParameters = request.getRequestParameters();
    final org.apache.wicket.util.string.StringValue user = requestParameters.getParameterValue("user");
    final org.apache.wicket.util.string.StringValue password = requestParameters.getParameterValue("pass");
    s.signIn(user.toString(), password.toString());
    return s;
}
Also used : AuthenticatedWebSessionForIsis(org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis) IRequestParameters(org.apache.wicket.request.IRequestParameters)

Aggregations

AuthenticatedWebSessionForIsis (org.apache.isis.viewer.wicket.viewer.integration.wicket.AuthenticatedWebSessionForIsis)1 IRequestParameters (org.apache.wicket.request.IRequestParameters)1