code: public UserAuthentication getOrCreateUser(App app, String accessToken) throws IOException {
  		UserAuthentication userAuth = null;
  		if (accessToken != null && accessToken.contains(Config.SEPARATOR)) {
  			String[] parts = accessToken.split(Config.SEPARATOR, 2);
  			String username = parts[0];
  			String password = parts[1];
  			try {
  				Authentication auth = new LDAPAuthentication(username, password).withApp(app);
  
  				// set authentication in context to avoid warning message from SpringSecurityAuthenticationSource
  				SecurityContextHolder.getContext().setAuthentication(new AnonymousAuthenticationToken("key",
  						"anonymous", AuthorityUtils.createAuthorityList("ROLE_ANONYMOUS")));
  				Authentication ldapAuth = getAuthenticationManager().authenticate(auth);
  				if (ldapAuth != null) {
  					//success!
  					userAuth = getOrCreateUser(app, ldapAuth);
  				}
  			} catch (Exception ex) {
  				LOG.info("Failed to authenticate '{}' with LDAP server: {}", username, ex.getMessage());
  			}
  		}
  		return SecurityUtils.checkIfActive(userAuth, SecurityUtils.getAuthenticatedUser(userAuth), false);
  	}
docs: Calls an external API to get the user profile using a given access token.
  @param app the app where the user will be created, use null for root app
  @param accessToken access token - in the case of LDAP this is should be "uid:password"
  @return {@link UserAuthentication} object or null if something went wrong
  @throws IOException ex