Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.AuthenticationProvider


     * @see org.apache.jetspeed.security.AuthenticationProviderProxy#setPublicPasswordCredential(org.apache.jetspeed.security.PasswordCredential,
     *      org.apache.jetspeed.security.PasswordCredential, java.lang.String)
     */
    public void setPassword(String userName, String oldPassword, String newPassword, String authenticationProvider) throws SecurityException
    {
        AuthenticationProvider provider = getAuthenticationProviderByName(authenticationProvider);
        if ( provider != null )
        {
            provider.getCredentialHandler().setPassword(userName,oldPassword,newPassword);
        }
        else
        {
            throw new SecurityException(SecurityException.INVALID_AUTHENTICATION_PROVIDER.create(authenticationProvider));
        }
View Full Code Here


    {
        Set privateCredentials = new HashSet();
        String providerName = getAuthenticationProvider(username);
        if ( providerName != null )
        {
            AuthenticationProvider provider = getAuthenticationProviderByName(providerName);
            privateCredentials.addAll(provider.getCredentialHandler().getPrivateCredentials(username));
        }
        return privateCredentials;
    }   
View Full Code Here

     * @see org.apache.jetspeed.security.AuthenticationProviderProxy#setPasswordEnabled(java.lang.String, boolean, java.lang.String)
     */
    public void setPasswordEnabled(String userName, boolean enabled, String authenticationProvider)
            throws SecurityException
    {
        AuthenticationProvider provider = getAuthenticationProviderByName(authenticationProvider);
        if ( provider != null )
        {
            provider.getCredentialHandler().setPasswordEnabled(userName,enabled);
        }
        else
        {
            throw new SecurityException(SecurityException.INVALID_AUTHENTICATION_PROVIDER.create(authenticationProvider));
        }
View Full Code Here

     * @see org.apache.jetspeed.security.AuthenticationProviderProxy#setPasswordUpdateRequired(java.lang.String, boolean, java.lang.String)
     */
    public void setPasswordUpdateRequired(String userName, boolean updateRequired, String authenticationProvider)
            throws SecurityException
    {
        AuthenticationProvider provider = getAuthenticationProviderByName(authenticationProvider);
        if ( provider != null )
        {
            provider.getCredentialHandler().setPasswordUpdateRequired(userName,updateRequired);
        }
        else
        {
            throw new SecurityException(SecurityException.INVALID_AUTHENTICATION_PROVIDER.create(authenticationProvider));
        }
View Full Code Here

    /**
     * @see org.apache.jetspeed.security.AuthenticationProviderProxy#authenticate(java.lang.String, char[], java.lang.String)
     */
    public boolean authenticate(String userName, String password, String authenticationProvider) throws SecurityException
    {
        AuthenticationProvider provider = getAuthenticationProviderByName(authenticationProvider);
        if ( provider != null )
        {
            return provider.getCredentialHandler().authenticate(userName, password);
        }
        else
        {
            throw new SecurityException(SecurityException.INVALID_AUTHENTICATION_PROVIDER.create(authenticationProvider));
        }
View Full Code Here

            if (username != null)
            {
                ComponentManager cm = Jetspeed.getComponentManager();
                UserManager userManager = (UserManager)cm.getComponent("org.apache.jetspeed.security.UserManager");
                AuditActivity audit = (AuditActivity)cm.getComponent("org.apache.jetspeed.audit.AuditActivity");
                AuthenticationProvider authProvider = (AuthenticationProvider)cm.getComponent("org.apache.jetspeed.security.AuthenticationProvider");
               
                // Commenting out for the using latest securty API's
                //boolean success = userManager.authenticate(username, password);
                //if (success)
                AuthenticatedUser authUser = null;
                try{
                  authUser = authProvider.authenticate(username, password)
                }
                catch (SecurityException e)
                {
                    audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_FAILURE, "PortalFilter");                   
                    request.getSession().setAttribute(LoginConstants.ERRORCODE, LoginConstants.ERROR_INVALID_PASSWORD);
View Full Code Here

  }

  public void doFilter(ServletRequest sRequest, ServletResponse sResponse, FilterChain filterChain) throws IOException, ServletException
  {
        ComponentManager cm = Jetspeed.getComponentManager();
    AuthenticationProvider authProvider = (AuthenticationProvider) cm.getComponent("org.apache.jetspeed.security.AuthenticationProvider");
    if (sRequest instanceof HttpServletRequest)
    {
      HttpServletRequest request = (HttpServletRequest) sRequest;
      if (userNameHeader == null)
      {
        synchronized (sem)
        {
          ShibbolethConfiguration config = (ShibbolethConfiguration) cm.getComponent(
              "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
          userNameHeader = config.getHeaderMapping().get(ShibbolethConfiguration.USERNAME);
        }
      }
      String username = request.getHeader(userNameHeader);
      if (username != null)
      {
        Subject subject = (Subject) request.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
        if (subject != null)
        {
          Principal principal = SubjectHelper.getPrincipal(subject, UserSubjectPrincipal.class);
          if (principal != null)
          {
            if (principal.getName().equals(username))
            {
              sRequest = wrapperRequest(request, subject, principal);
              if (filterChain != null)
              {
                filterChain.doFilter(sRequest, sResponse);
                return;
              }
            }
          }
        }
        UserManager userManager = (UserManager) cm.getComponent("org.apache.jetspeed.security.UserManager");
        AuditActivity audit = (AuditActivity) cm.getComponent("org.apache.jetspeed.audit.AuditActivity");
        ShibbolethConfiguration config = (ShibbolethConfiguration) cm.getComponent(
            "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
        boolean success = false;
        if (config.isAuthenticate())
        {
          try
          {
            authProvider.authenticate(username, username);
            success = true;
          }
          catch (SecurityException e)
          {
            throw new ServletException();
View Full Code Here

  }

  public void doFilter(ServletRequest sRequest, ServletResponse sResponse, FilterChain filterChain) throws IOException, ServletException
  {
        ComponentManager cm = Jetspeed.getComponentManager();
    AuthenticationProvider authProvider = (AuthenticationProvider) cm.getComponent("org.apache.jetspeed.security.AuthenticationProvider");
    if (sRequest instanceof HttpServletRequest)
    {
      HttpServletRequest request = (HttpServletRequest) sRequest;
            HttpSession httpSession = PortalSessionValidationFilter.getValidSession(request);
      if (userNameHeader == null)
      {
        synchronized (sem)
        {
          ShibbolethConfiguration config = (ShibbolethConfiguration) cm.getComponent(
              "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
          userNameHeader = config.getHeaderMapping().get(ShibbolethConfiguration.USERNAME);
        }
      }
      String username = request.getHeader(userNameHeader);
      if (username != null)
      {
        Subject subject = (Subject) request.getSession().getAttribute(PortalReservedParameters.SESSION_KEY_SUBJECT);
        if (subject != null)
        {
          Principal principal = SubjectHelper.getPrincipal(subject, UserSubjectPrincipal.class);
          if (principal != null)
          {
            if (principal.getName().equals(username))
            {
              sRequest = wrapperRequest(request, subject, principal);
              if (filterChain != null)
              {
                filterChain.doFilter(sRequest, sResponse);
                return;
              }
            }
          }
        }
        UserManager userManager = (UserManager) cm.getComponent("org.apache.jetspeed.security.UserManager");
        AuditActivity audit = (AuditActivity) cm.getComponent("org.apache.jetspeed.audit.AuditActivity");
        ShibbolethConfiguration config = (ShibbolethConfiguration) cm.getComponent(
            "org.apache.jetspeed.security.shibboleth.ShibbolethConfiguration");
        boolean success = false;
        if (config.isAuthenticate())
        {
          try
          {
            authProvider.authenticate(username, username);
            success = true;
          }
          catch (SecurityException e)
          {
            throw new ServletException();
View Full Code Here

            if (username != null)
            {
                ComponentManager cm = Jetspeed.getComponentManager();
                UserManager userManager = (UserManager)cm.getComponent("org.apache.jetspeed.security.UserManager");
                AuditActivity audit = (AuditActivity)cm.getComponent("org.apache.jetspeed.audit.AuditActivity");
                AuthenticationProvider authProvider = (AuthenticationProvider)cm.getComponent("org.apache.jetspeed.security.AuthenticationProvider");
               
                // Commenting out for the using latest securty API's
                //boolean success = userManager.authenticate(username, password);
                //if (success)
                AuthenticatedUser authUser = null;
                try{
                  authUser = authProvider.authenticate(username, password)
                }
                catch (SecurityException e)
                {
                    audit.logUserActivity(username, request.getRemoteAddr(), AuditActivity.AUTHENTICATION_FAILURE, "PortalFilter");                   
                    request.getSession().setAttribute(LoginConstants.ERRORCODE, LoginConstants.ERROR_INVALID_PASSWORD);
View Full Code Here

TOP

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

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.