Package org.tmatesoft.svn.core.auth

Examples of org.tmatesoft.svn.core.auth.SVNUserNameAuthentication


        } else if(ISVNAuthenticationManager.USERNAME.equals(kind)) {
            String userName = previousAuth != null && previousAuth.getUserName() != null ? previousAuth.getUserName() : getUserName(null, url);
            if (myPrompt instanceof PromptUserPasswordUser) {
                PromptUserPasswordUser prompt3 = (PromptUserPasswordUser) myPrompt;
                if (prompt3.promptUser(realm, userName, authMayBeStored))  {
                    return new SVNUserNameAuthentication(prompt3.getUsername(), prompt3.userAllowedSave());
                }
                return getDefaultUserNameCredentials(userName);
            } else if (myPrompt instanceof PromptUserPassword3) {
                PromptUserPassword3 prompt3 = (PromptUserPassword3) myPrompt;
                if (prompt3.prompt(realm, userName, authMayBeStored))  {
                    return new SVNUserNameAuthentication(prompt3.getUsername(), prompt3.userAllowedSave());
                }
                return getDefaultUserNameCredentials(userName);
            }
            if (myPrompt.prompt(realm, userName)) {
                return new SVNUserNameAuthentication(myPrompt.getUsername(), false);
            }
            return getDefaultUserNameCredentials(userName);
        } else if(!ISVNAuthenticationManager.PASSWORD.equals(kind)){
            return null;
        }
View Full Code Here


    }

    private SVNAuthentication getDefaultUserNameCredentials(String userName) {
        if (ADAPTER_DEFAULT_PROMPT_CLASS.equals(myPrompt.getClass().getName())) {
            // return default username, despite prompt was 'cancelled'.
            return new SVNUserNameAuthentication(userName, false);
        }
        return null;
    }
View Full Code Here

                            "".equals(author.getUserName())) {
                        repository.setExternalUserName("");
                    } else {
                        repository.setExternalUserName(author.getUserName());
                    }
                    author = new SVNUserNameAuthentication(userName, author.isStorageAllowed());
                    authManager.acknowledgeAuthentication(true, ISVNAuthenticationManager.USERNAME, realm, null, author);
   
                    if ("".equals(repository.getExternalUserName())) {
                        mySession.execCommand(SVNSERVE_COMMAND);
                    } else {
View Full Code Here

      credentials = new SCMCredentialConfiguration(sshAuth.getUserName(), sshAuth.getPassword(), sshAuth.getPassphrase(), sshAuth.getPrivateKey());
    } else if(auth instanceof SVNSSLAuthentication){
      SVNSSLAuthentication sslAuth = (SVNSSLAuthentication)auth;
      credentials = new SCMCredentialConfiguration(sslAuth.getUserName(), sslAuth.getPassword());
    } else if(auth instanceof SVNUserNameAuthentication){
      SVNUserNameAuthentication unameAuth = (SVNUserNameAuthentication)auth;
      credentials = new SCMCredentialConfiguration(unameAuth.getUserName());
    }

        if(credentials != null){
            LOGGER.info("Created SCM Credentials for user "+credentials.getUsername()+"...");
        }
View Full Code Here

                            "".equals(author.getUserName())) {
                        repository.setExternalUserName("");
                    } else {
                        repository.setExternalUserName(author.getUserName());
                    }
                    author = new SVNUserNameAuthentication(userName, author.isStorageAllowed());
                    authManager.acknowledgeAuthentication(true, ISVNAuthenticationManager.USERNAME, realm, null, author);
   
                    if ("".equals(repository.getExternalUserName())) {
                        mySession.execCommand(SVNSERVE_COMMAND);
                    } else {
View Full Code Here

                while (auth != null) {
                    String userName = auth.getUserName();
                    if (userName == null || "".equals(userName.trim())) {
                        userName = System.getProperty("user.name");
                    }
                    auth = new SVNUserNameAuthentication(userName, auth.isStorageAllowed());
                    if (userName != null && !"".equals(userName.trim())) {                       
                        authManager.acknowledgeAuthentication(true, ISVNAuthenticationManager.USERNAME, realm, null, auth);
                        return auth.getUserName();
                    }
                    SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.AUTHN_CREDS_UNAVAILABLE, "Empty user name is not allowed");
View Full Code Here

            }
            String userName = auth.getUserName();
            if (userName == null || "".equals(userName.trim())) {
                userName = System.getProperty("user.name");
            }
            auth = new SVNUserNameAuthentication(userName, auth.isStorageAllowed());
            repository.getAuthenticationManager().acknowledgeAuthentication(true, ISVNAuthenticationManager.USERNAME, host, null, auth);
            expandedTunnel += " --tunnel-user " + userName;
           
            repository.setExternalUserName(userName);
        }
View Full Code Here

                    "Username [" + System.getProperty("user.name") + "]");
                if ("".equals(name) || name == null) {
                    name = System.getProperty("user.name");
                }
            }
            return new SVNUserNameAuthentication(name, authMayBeStored);
        } else if (ISVNAuthenticationManager.SSL.equals(kind)) {
            printRealm(realm);
            String path = null;
            while(path == null) {
                path = prompt("Client certificate filename");
View Full Code Here

        } else if(ISVNAuthenticationManager.USERNAME.equals(kind)) {
            String userName = previousAuth != null && previousAuth.getUserName() != null ? previousAuth.getUserName() : getUserName(null, url);
            if (myPrompt instanceof PromptUserPasswordUser) {
                PromptUserPasswordUser prompt3 = (PromptUserPasswordUser) myPrompt;
                if (prompt3.promptUser(realm, userName, authMayBeStored))  {
                    return new SVNUserNameAuthentication(prompt3.getUsername(), prompt3.userAllowedSave());
                }
                return getDefaultUserNameCredentials(userName);
            } else if (myPrompt instanceof PromptUserPassword3) {
                PromptUserPassword3 prompt3 = (PromptUserPassword3) myPrompt;
                if (prompt3.prompt(realm, userName, authMayBeStored))  {
                    return new SVNUserNameAuthentication(prompt3.getUsername(), prompt3.userAllowedSave());
                }
                return getDefaultUserNameCredentials(userName);
            }
            if (myPrompt.prompt(realm, userName)) {
                return new SVNUserNameAuthentication(myPrompt.getUsername(), false);
            }
            return getDefaultUserNameCredentials(userName);
        } else if(!ISVNAuthenticationManager.PASSWORD.equals(kind)){
            return null;
        }
View Full Code Here

    }

    private SVNAuthentication getDefaultUserNameCredentials(String userName) {
        if (ADAPTER_DEFAULT_PROMPT_CLASS.equals(myPrompt.getClass().getName())) {
            // return default username, despite prompt was 'cancelled'.
            return new SVNUserNameAuthentication(userName, false);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.tmatesoft.svn.core.auth.SVNUserNameAuthentication

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.