Return a driver for a Neo4j instance with the default configuration settings

@param uri the URL to a Neo4j instance
@param authToken authentication to use, see {@link AuthTokens}
@return a new driver to the database instance specified by the URL
11057
public static Driver driver( String uri, AuthToken authToken )
    {
        return driver( uri, authToken, Config.defaultConfig() );
    }
996985
public OAuthToken getToken() throws Exception {
        OAuthToken token = storageStrategy.get(getEnvKey());
        
        if (token == null || token.IsExpired()) {
            storeToken(this.root.getAuthenticationManager().createToken());
        }
        
        return storageStrategy.get(getEnvKey());
    }
645630
public static String getUserNameFromToken(String authToken) {
        if (null == authToken) {
            return null;
        }

        return authToken.split(TOKEN_SEPARATOR)[0];
    }
562892
public CouchDB auth(String username, String password) {
        return username(username).password(password);
    }
899761
public Account authenticate(AuthenticationToken authenticationToken) {

        if (accountCache != null) {
            Account account = accountCache.getIfPresent(authenticationToken);
            if (account != null) {
                return account;
            }
        }

        Account authenticatedAccount = null;
        for (Realm realm : allRealms) {
            if (realm.canAuthenticate(authenticationToken)) {
                Account account = realm.authenticate(authenticationToken);
                if (account != null && !account.isDisabled()) {
                    // create a sanitized copy of this account
                    authenticatedAccount = new Account(account.getName(), account.getCredentials().sanitize());
                    break;
                }
            }
        }

        // no authentication
        if (authenticatedAccount == null) {
            return null;
        }

        // aggregate metadata, roles, & permissions
        final Account aggregateAccount = authenticatedAccount;
        allRealms.stream()
                .filter(realm -> realm.hasAccount(aggregateAccount.getUsername()))
                .map(realm -> realm.getAccount(aggregateAccount.getUsername()))
                .filter(account -> account.isEnabled())
                .forEach(account -> {
                    if (Strings.isNullOrEmpty(aggregateAccount.getName())) {
                        aggregateAccount.setName(account.getName());
                    }
                    aggregateAccount.addEmailAddresses(account.getEmailAddresses());
                    aggregateAccount.addTokens(account.getTokens());
                    aggregateAccount.getAuthorizations()
                            .addRoles(account.getAuthorizations().getRoles())
                            .addPermissions(account.getAuthorizations().getPermissions());
                });

        if (accountCache != null) {
            // cache this assembled account
            accountCache.put(authenticationToken, aggregateAccount);
        }

        return aggregateAccount;
    }
606035
@Override
    public void setAuthConfigFactory(AuthConfigFactory factory) {
        this.registry = factory;
        if (tc.isDebugEnabled())
            Tr.debug(tc, "AuthConfigFactory = " + factory);
    }
1088745
public static Driver driver( String uri, Config config )
    {
        return driver( URI.create( uri ), config );
    }
366992
public static Configuration configureWithAzureAdTokenProvider(
            Configuration configuration,
            URI apiServer,
            TokenProvider azureAdTokenProvider) {

        configuration.setProperty(AZURE_AD_API_SERVER, apiServer.toString());
        configuration.setProperty(AZURE_AD_TOKEN_PROVIDER, azureAdTokenProvider);

        return configuration;
    }
51499
public Auth checkToken(OAuth1Token accessToken) throws FlickrException {
        return checkToken(accessToken.getToken(), accessToken.getTokenSecret());
    }
1336112
public int auth_getUserId(String authToken)
    throws FacebookException, IOException {
    /*
     * Get the session information if we don't have it; this will populate
	   * the user ID as well.
	   */
    if (null == this._sessionKey)
      auth_getSession(authToken);
    return this._userId;
  }
358679
public static Configuration configureWithAzureAdTokenProvider(
            URI apiServer,
            TokenProvider azureAdTokenProvider) {

        return configureWithAzureAdTokenProvider(Configuration.getInstance(), apiServer, azureAdTokenProvider);
    }
137651
public static UriComponentsBuilder fromUri(URI uri) {
		UriComponentsBuilder builder = new UriComponentsBuilder();
		builder.uri(uri);
		return builder;
	}
811472
public ConnectionOptions withUri(URI uri)
    throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException
  {
     factory.setUri(Assert.notNull(uri, "URI"));
     return this;
  }
416231
public String auth_getSession(String authToken) throws FacebookException,
                                                         IOException {
    if (null != this._sessionKey) {
      return this._sessionKey;
    }
    Document d =
      this.callMethod(FacebookMethod.AUTH_GET_SESSION, 
                      new Pair<String, CharSequence>("auth_token", authToken.toString()));
    this._sessionKey =
        d.getElementsByTagName("session_key").item(0).getFirstChild().getTextContent();
    this._userId = Integer.parseInt(d.getElementsByTagName("uid").item(0).getFirstChild().getTextContent());
    if (this._isDesktop) {
      this._sessionSecret =
          d.getElementsByTagName("secret").item(0).getFirstChild().getTextContent();
    }
    return this._sessionKey;
  }
1098068
public void setAuthToken(String authToken){
        if (authToken != null && authToken.length() != AUTH_TOKEN_LENGTH){            
            throw new IllegalArgumentException(authToken+" is not "+AUTH_TOKEN_LENGTH+" characters long.");
        }
        setParameter(AUTH_TOKEN, authToken);
    }
531696
@Nonnull
  public static AuthIdentificationResult createSuccess (@Nonnull final IAuthToken aAuthToken)
  {
    ValueEnforcer.notNull (aAuthToken, "AuthToken");
    return new AuthIdentificationResult (aAuthToken, null);
  }
1360317
public RestApi initialiseRestClient(int logLevelNet, APIConfig.BaseURIs baseURIs) {

        AuthManager authManager = new AuthManager() {
            @Override
            protected Observable<SessionData> restartSession() {
                return reAuthenticate();
            }
        };

        restClient = new RestClient(new OkHttpAuthenticator(authManager), logLevelNet, baseURIs.getService().toString());
        service = restClient.getService();
        setService(service);
        return service;
    }