Package org.apache.ftpserver.usermanager

Examples of org.apache.ftpserver.usermanager.UsernamePasswordAuthentication


     * User authenticate method
     */
    public User authenticate(Authentication authentication)
            throws AuthenticationFailedException {
        if (authentication instanceof UsernamePasswordAuthentication) {
            UsernamePasswordAuthentication upauth = (UsernamePasswordAuthentication) authentication;

            String user = upauth.getUsername();
            String password = upauth.getPassword();

            if (user == null) {
                throw new AuthenticationFailedException("Authentication failed");
            }

View Full Code Here


     * User authentication.
     */
    public User authenticate(Authentication authentication)
            throws AuthenticationFailedException {
        if (authentication instanceof UsernamePasswordAuthentication) {
            UsernamePasswordAuthentication upauth = (UsernamePasswordAuthentication) authentication;

            String user = upauth.getUsername();
            String password = upauth.getPassword();

            if (user == null) {
                throw new AuthenticationFailedException("Authentication failed");
            }

View Full Code Here

        @Override
        public User authenticate(Authentication authentication)
                throws AuthenticationFailedException {
            if (UsernamePasswordAuthentication.class
                    .isAssignableFrom(authentication.getClass())) {
                UsernamePasswordAuthentication upAuth =
                        (UsernamePasswordAuthentication) authentication;

                if (TEST_USERNAME.equals(upAuth.getUsername())
                        && TEST_PASSWORD.equals(upAuth.getPassword())) {
                    return testUser;
                }

                if (anonUser.getName().equals(upAuth.getUsername())) {
                    return anonUser;
                }
            } else if (AnonymousAuthentication.class
                    .isAssignableFrom(authentication.getClass())) {
                return anonUser;
View Full Code Here

      org.structr.web.entity.User user = null;
     
      try (Tx tx = StructrApp.getInstance().tx()) {

        UsernamePasswordAuthentication authentication = (UsernamePasswordAuthentication) auth;

        userName = authentication.getUsername();
        password = authentication.getPassword();

        user = (org.structr.web.entity.User) AuthHelper.getPrincipalForPassword(AbstractUser.name, userName, password);
      } catch (FrameworkException ex) {
        logger.log(Level.WARNING, "FTP authentication attempt failed with username {0} and password {1}", new Object[]{userName, password});
      }
View Full Code Here

     * User authentication.
     */
    public User authenticate(Authentication authentication)
            throws AuthenticationFailedException {
        if (authentication instanceof UsernamePasswordAuthentication) {
            UsernamePasswordAuthentication upauth = (UsernamePasswordAuthentication) authentication;

            String user = upauth.getUsername();
            String password = upauth.getPassword();

            if (user == null) {
                throw new AuthenticationFailedException("Authentication failed");
            }

View Full Code Here

     * User authentication.
     */
    public User authenticate(Authentication authentication)
            throws AuthenticationFailedException {
        if (authentication instanceof UsernamePasswordAuthentication) {
            UsernamePasswordAuthentication upauth = (UsernamePasswordAuthentication) authentication;

            String user = upauth.getUsername();
            String password = upauth.getPassword();

            if (user == null) {
                throw new AuthenticationFailedException("Authentication failed");
            }

View Full Code Here

                Authentication auth;
                if (anonymous) {
                    auth = new AnonymousAuthentication(userMetadata);
                } else {
                    auth = new UsernamePasswordAuthentication(userName,
                            password, userMetadata);
                }

                authenticatedUser = userManager.authenticate(auth);
            } catch (AuthenticationFailedException e) {
View Full Code Here

                Authentication auth;
                if (anonymous) {
                    auth = new AnonymousAuthentication(userMetadata);
                } else {
                    auth = new UsernamePasswordAuthentication(userName,
                            password, userMetadata);
                }

                authenticatedUser = userManager.authenticate(auth);
            } catch (AuthenticationFailedException e) {
View Full Code Here

    public User authenticate(final Authentication ftpAuthRequest)
            throws AuthenticationFailedException {
        if (!(ftpAuthRequest instanceof UsernamePasswordAuthentication)) {
            throw new AuthenticationFailedException();
        }
        final UsernamePasswordAuthentication upa = (UsernamePasswordAuthentication) ftpAuthRequest;
        final String principal = upa.getUsername();
        final String credentials = upa.getPassword();
        org.springframework.security.core.Authentication gsAuth = new UsernamePasswordAuthenticationToken(
                principal, credentials);
        try {
            gsAuth = authManager.authenticate(gsAuth);
        } catch (org.springframework.security.core.AuthenticationException authEx) {
View Full Code Here

    public User authenticate(final Authentication ftpAuthRequest)
            throws AuthenticationFailedException {
        if (!(ftpAuthRequest instanceof UsernamePasswordAuthentication)) {
            throw new AuthenticationFailedException();
        }
        final UsernamePasswordAuthentication upa = (UsernamePasswordAuthentication) ftpAuthRequest;
        final String principal = upa.getUsername();
        final String credentials = upa.getPassword();
        org.springframework.security.Authentication gsAuth = new UsernamePasswordAuthenticationToken(
                principal, credentials);
        try {
            gsAuth = authManager.authenticate(gsAuth);
        } catch (org.springframework.security.AuthenticationException authEx) {
View Full Code Here

TOP

Related Classes of org.apache.ftpserver.usermanager.UsernamePasswordAuthentication

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.