Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.PasswordCredential


                    try
                    {
                        //manager.setPassword(userName, currPassword, newPassword);
                      // Changes for new Security API's
                      User user = manager.getUser(userName);
                      PasswordCredential credential = manager.getPasswordCredential(user);
                      credential.setPassword(currPassword, newPassword);
                      manager.storePasswordCredential(credential);
                        audit.logUserActivity(userName, getIPAddress(actionRequest), AuditActivity.PASSWORD_CHANGE_SUCCESS, USER_ADMINISTRATION);

                        // update Subject in session to reflect the changed PasswordCredential
                        RequestContext requestContext = (RequestContext)actionRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);                 
View Full Code Here


            response.getWriter().print(NO_CREDENTIALS);
            return;
        }
        else
        {
          PasswordCredential pwc = SSOPortletUtil.getCredentialsForSite(sso,siteName,request);
          if (pwc != null)
          {
                request.setAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME, pwc.getUserName());
                request.setAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD, pwc.getPassword());
          } else
          {
                response.getWriter().print(NO_CREDENTIALS);
                return;
          }
View Full Code Here

    public void doEdit(RenderRequest request, RenderResponse response)
    throws PortletException, IOException
    {
        String site = request.getPreferences().getValue("SRC", "");
      PasswordCredential pwc = SSOPortletUtil.getCredentialsForSite(sso,site,request);
      if (pwc != null)
      {
            getContext(request).put(SSO_EDIT_FIELD_PRINCIPAL, pwc.getUserName());
            getContext(request).put(SSO_EDIT_FIELD_CREDENTIAL, pwc.getPassword());
        }
      else
      {
            // no credentials configured in SSO store
            // switch to SSO Configure View
View Full Code Here

                            if (!StringUtils.isBlank(ssoSite.getRealm()))
                            {
                                ssoCreds.setRealm(ssoSite.getRealm());
                            }
                           
                            PasswordCredential pwc = ssoManager.getCredentials(ssoUser);
                            ssoCreds.setUsername(pwc.getUserName());
                            ssoCreds.setPassword(pwc.getPassword());
                           
                            if (ssoSite.isFormAuthentication())
                            {
                                ssoCreds.setFormAuthentication(true);
                                ssoCreds.setFormUserField(ssoSite.getFormUserField());
View Full Code Here

                                error(e.getMessage());
                            }
                        }
                        userManager.updateUser(user);
                                               
                        PasswordCredential credential = userManager
                                .getPasswordCredential(user);
                        if (!StringUtils.isEmpty(getPassword()))
                        {
                            credential.setPassword(getPassword(), false);
                        }
                        credential.setUpdateRequired(isCheckpass());
                        userManager.storePasswordCredential(credential);
                        setPrincipal(user);
                        controlPannels(true);
                    }
                    catch (SecurityException jSx)
View Full Code Here

                        {
                            try
                            {
                                RequestContext rc = SecurityHelper.getRequestContext(actionRequest);
                                User user = userManager.getUser(userBean.getUsername());                                                       
                                PasswordCredential pwc = userManager.getPasswordCredential(user);
                                pwc.setEnabled(false);
                                userManager.storePasswordCredential(pwc);
                                SecurityHelper.updateCredentialInSession(rc, pwc);
                                userBean.setUser(user);
                                userAttributes = userBean.getUser().getSecurityAttributes().getAttributeMap();                               
                                user.getSecurityAttributes().getAttribute("user.question.failures", true).setStringValue("0");                               
View Full Code Here

            try
            {
                SSOUser remoteUser = SSOPortletUtil.getRemoteUser(sso, request, site);
                if (remoteUser != null)
                {
                    PasswordCredential pwc = sso.getCredentials(remoteUser);
                    getContext(request).put(SSO_FORM_PRINCIPAL, pwc.getUserName());
                    getContext(request).put(SSO_FORM_CREDENTIAL, pwc.getPassword());
                }
                else
                {
                    getContext(request).put(SSO_FORM_PRINCIPAL, "");
                    getContext(request).put(SSO_FORM_CREDENTIAL, "");
View Full Code Here

        try
        {
            SSOUser remoteUser = SSOPortletUtil.getRemoteUser(sso, request, site);
            if (remoteUser != null)
            {
                PasswordCredential pwc = sso.getCredentials(remoteUser);
                request.setAttribute(SSO_REQUEST_ATTRIBUTE_USERNAME, pwc.getUserName());
                request.setAttribute(SSO_REQUEST_ATTRIBUTE_PASSWORD, pwc.getPassword());
            }
            else
            {
                response.getWriter().print(SSOWebContentPortlet.NO_CREDENTIALS);
                return;
View Full Code Here

       
    }
   
    public static PasswordCredential getCredentialsForSite(SSOManager sso, String siteUrl, RenderRequest request)
    {
        PasswordCredential pwc = null;
        SSOSite site = sso.getSiteByUrl(siteUrl);
        if (site != null)
        {
            return getCredentialsForSite(sso, site, request);
        }
View Full Code Here

        return pwc;
    }

    public static PasswordCredential getCredentialsForSite(SSOManager sso, SSOSite site, RenderRequest request)
    {
        PasswordCredential pwc = null;
        try
        {
            SSOUser remoteUser = getRemoteUser(sso, request, site);
            if (remoteUser != null)
            {
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.PasswordCredential

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.