Codota Logo
AuthenticationPlugin.authenticate
Code IndexAdd Codota to your IDE (free)

How to use
authenticate
method
in
org.crsh.auth.AuthenticationPlugin

Best Java code snippets using org.crsh.auth.AuthenticationPlugin.authenticate (Showing top 5 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: crashub/crash

 private <T> boolean genericAuthenticate(Class<T> type, String username, T credential) {
  for (AuthenticationPlugin authenticationPlugin : authenticationPlugins) {
   if (authenticationPlugin.getCredentialType().equals(type)) {
    try {
     log.log(Level.FINE, "Using authentication plugin " + authenticationPlugin + " to authenticate user " + username);
     @SuppressWarnings("unchecked")
     AuthenticationPlugin<T> authPlugin = (AuthenticationPlugin<T>) authenticationPlugin;
     if (authPlugin.authenticate(username, credential)) {
      return true;
     }
    } catch (Exception e) {
     log.log(Level.SEVERE, "Exception authenticating user " + username + " in authentication plugin: " + authenticationPlugin, e);
    }
   }
  }

  return false;
 }
}
origin: org.crsh/crsh.shell.ssh

 public boolean authenticate(String username, PublicKey key, ServerSession session) {
  try {
   log.log(Level.FINE, "Using authentication plugin " + authentication + " to authenticate user " + username);
   return keyAuthentication.authenticate(username, key);
  }
  catch (Exception e) {
   log.log(Level.SEVERE, "Exception authenticating user " + username + " in authentication plugin: " + authentication, e);
   return false;
  }
 }
});
origin: org.crashub/crash.connectors.ssh

 private <T> boolean genericAuthenticate(Class<T> type, String username, T credential) {
  for (AuthenticationPlugin authenticationPlugin : authenticationPlugins) {
   if (authenticationPlugin.getCredentialType().equals(type)) {
    try {
     log.log(Level.FINE, "Using authentication plugin " + authenticationPlugin + " to authenticate user " + username);
     @SuppressWarnings("unchecked")
     AuthenticationPlugin<T> authPlugin = (AuthenticationPlugin<T>) authenticationPlugin;
     if (authPlugin.authenticate(username, credential)) {
      return true;
     }
    } catch (Exception e) {
     log.log(Level.SEVERE, "Exception authenticating user " + username + " in authentication plugin: " + authenticationPlugin, e);
    }
   }
  }

  return false;
 }
}
origin: com.github.corda.crash/crash.connectors.ssh

 private <T> AuthInfo genericAuthenticate(Class<T> type, String username, T credential) {
  for (AuthenticationPlugin authenticationPlugin : authenticationPlugins) {
   if (authenticationPlugin.getCredentialType().equals(type)) {
    try {
     log.log(Level.FINE, "Using authentication plugin " + authenticationPlugin + " to authenticate user " + username);
     @SuppressWarnings("unchecked")
     AuthenticationPlugin<T> authPlugin = (AuthenticationPlugin<T>) authenticationPlugin;
     return authPlugin.authenticate(username, credential);
    } catch (Exception e) {
     log.log(Level.SEVERE, "Exception authenticating user " + username + " in authentication plugin: " + authenticationPlugin, e);
    }
   }
  }

  return AuthInfo.UNSUCCESSFUL;
 }
}
origin: org.crsh/crsh.shell.ssh

  public boolean authenticate(String _username, String _password, ServerSession session) {
   boolean auth;
   try {
    log.log(Level.FINE, "Using authentication plugin " + authentication + " to authenticate user " + _username);
    auth = passwordAuthentication.authenticate(_username, _password);
   } catch (Exception e) {
    log.log(Level.SEVERE, "Exception authenticating user " + _username + " in authentication plugin: " + authentication, e);
    return false;
   }
  // We store username and password in session for later reuse
  session.setAttribute(USERNAME, _username);
  session.setAttribute(PASSWORD, _password);
  //
  return auth;
 }
});
org.crsh.authAuthenticationPluginauthenticate

Javadoc

Returns true if the user is authentified by its username and credential.

Popular methods of AuthenticationPlugin

  • getCredentialType
    Returns the credential type.
  • getName
    Returns the authentication plugin name.

Popular in Java

  • Reading from database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileOutputStream (java.io)
    A file output stream is an output stream for writing data to aFile or to a FileDescriptor. Whether
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now