On Jan 20, 2009, at 6:46 PM, ShilpaOSI wrote:


I am using Jetspeed 2.1.3.So Where are the login details stored, and how should I extract them.I want to use user id and the password through which a user login to Jetspeed.So that I can use the same details to open other link
without promting for a login screen.

OK, I understand now. Sorry Im so dense.

Take a look at the SSOIFramePortlet.java, here are the key ingredients, (you might want to take more care for checking for unauthenticated users etc) In this case we are getting the credentials for the current, logged on user:

            Subject subject = getSubject();
            SSOContext context = sso.getCredentials(subject, site);
request.setAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME, context.getRemotePrincipalName()); request.setAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD, context.getRemoteCredential());

    private Subject getSubject()
    {
        AccessControlContext context = AccessController.getContext();
        return JSSubject.getSubject(context);
    }

Reply via email to