Package org.tmatesoft.svn.core.auth

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


                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


        }
        // end of probe. if we were asked for username for ssh and didn't find anything
        // report something default.
        if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
            // user auth shouldn't be null.
            return new SVNUserNameAuthentication("", isAuthStorageEnabled());
        }
        SVNErrorManager.authenticationFailed("Authentication required for ''{0}''", realm);
        return null;
    }
View Full Code Here

                    return new SVNPasswordAuthentication(myUserName, myPassword, myIsStore);
                } else if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
                    if (myUserName == null || "".equals(myUserName)) {
                        String userName = System.getProperty("svnkit.ssh2.author", System.getProperty("javasvn.ssh2.author"));
                        if (userName != null) {
                            return new SVNUserNameAuthentication(userName, myIsStore);
                        }
                        return null;
                    }
                    return new SVNUserNameAuthentication(myUserName, myIsStore);
                }
            }
            return null;
        }
View Full Code Here

                            return new SVNSSHAuthentication(userName, new File(path), passphrase, portNumber, authMayBeStored);
                        } else if (password != null) {
                            return new SVNSSHAuthentication(userName, password, portNumber, authMayBeStored);
                        }                   
                    } else if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
                        return new SVNUserNameAuthentication(userName, authMayBeStored);
                    }
                } catch (SVNException e) {
                    //
                }
            }
View Full Code Here

            String name = System.getProperty("user.name");
            if (name != null && "".equals(name.trim())) {
                name = null;
            }
            if (name != null) {
                return new SVNUserNameAuthentication(name, authMayBeStored);
            }
            printRealm(realm);
            name = prompt(!"file".equals(url.getProtocol()) ?
                "Author name [" + System.getProperty("user.name") + "]" :
                "Username [" + System.getProperty("user.name") + "]");
            if (name == null) {
                return null;
            }
            if ("".equals(name.trim())) {
                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

        }
        // end of probe. if we were asked for username for ssh and didn't find anything
        // report something default.
        if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
            // user auth shouldn't be null.
            return new SVNUserNameAuthentication("", isAuthStorageEnabled());
        }
        SVNErrorManager.authenticationFailed("Authentication required for ''{0}''", realm);
        return null;
    }
View Full Code Here

                    return new SVNPasswordAuthentication(myUserName, myPassword, myIsStore);
                } else if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
                    if (myUserName == null || "".equals(myUserName)) {
                        String userName = System.getProperty("svnkit.ssh2.author", System.getProperty("javasvn.ssh2.author"));
                        if (userName != null) {
                            return new SVNUserNameAuthentication(userName, myIsStore);
                        }
                        return null;
                    }
                    return new SVNUserNameAuthentication(myUserName, myIsStore);
                }
            }
            return null;
        }
View Full Code Here

                            return new SVNSSHAuthentication(userName, new File(path), passphrase, portNumber, authMayBeStored);
                        } else if (password != null) {
                            return new SVNSSHAuthentication(userName, password, portNumber, authMayBeStored);
                        }                   
                    } else if (ISVNAuthenticationManager.USERNAME.equals(kind)) {
                        return new SVNUserNameAuthentication(userName, authMayBeStored);
                    }
                } catch (SVNException e) {
                    //
                }
            }
View Full Code Here

        } else {
            activitiesDBDir = new File(activitiesDB);
        }
       
        String userName = myUserPrincipal != null ? myUserPrincipal.getName() : null;
        SVNAuthentication auth = new SVNUserNameAuthentication(userName, false, null, false);
        BasicAuthenticationManager authManager = new BasicAuthenticationManager(new SVNAuthentication[] { auth });
        SVNRepository resourceRepository = SVNRepositoryFactory.create(SVNURL.parseURIEncoded(getResourceRepositoryRoot()));
        resourceRepository.setAuthenticationManager(authManager);
        DAVResource resource = new DAVResource(resourceRepository, this, resourceURI, isSVNClient, deltaBase, version,
                clientOptions, baseChecksum, resultChecksum, userName, activitiesDBDir, lockTokens, capabilities);
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.