congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
UsernamePasswordHandler.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.jboss.security.auth.callback.UsernamePasswordHandler
constructor

Best Java code snippets using org.jboss.security.auth.callback.UsernamePasswordHandler.<init> (Showing top 5 results out of 315)

origin: stackoverflow.com

 String SECURITY_DOMAIN_NAME = "ssd"; // the security domain's name from standalone.xml

String username = "user";
String password = "password";

LoginContext lc = null;
try {
  lc = new LoginContext(SECURITY_DOMAIN_NAME, new UsernamePasswordHandler(username, password.toCharArray()));
  lc.login();
  // successful login
} catch (LoginException loginException) {
  // failed login
}
origin: org.rhq/rhq-enterprise-server

private void _checkAuthentication(String username, String password) throws LoginException {
  try {
    UsernamePasswordHandler handler = new UsernamePasswordHandler(username, password.toCharArray());
    LoginContext loginContext;
    loginContext = new LoginContext(CustomJaasDeploymentServiceMBean.RHQ_USER_SECURITY_DOMAIN, handler);
    loginContext.login();
    loginContext.getSubject().getPrincipals().iterator().next();
    loginContext.logout();
  } catch (javax.security.auth.login.LoginException e) {
    throw new LoginException(e.getMessage());
  }
}
origin: org.wildfly/wildfly-testsuite-shared

/**
 * Creates login context for given {@link Krb5LoginConfiguration} and credentials and calls the {@link LoginContext#login()}
 * method on it. This method contains workaround for IBM JDK issue described in bugzilla <a
 * href="https://bugzilla.redhat.com/show_bug.cgi?id=1206177">https://bugzilla.redhat.com/show_bug.cgi?id=1206177</a>.
 *
 * @param krb5Configuration
 * @param user
 * @param pass
 * @return
 * @throws LoginException
 */
public static LoginContext loginWithKerberos(final Krb5LoginConfiguration krb5Configuration, final String user,
    final String pass) throws LoginException {
  LoginContext lc = new LoginContext(krb5Configuration.getName(), new UsernamePasswordHandler(user, pass));
  if (IBM_JDK) {
    // workaround for IBM JDK on RHEL5 issue described in https://bugzilla.redhat.com/show_bug.cgi?id=1206177
    // The first negotiation always fail, so let's do a dummy login/logout round.
    lc.login();
    lc.logout();
    lc = new LoginContext(krb5Configuration.getName(), new UsernamePasswordHandler(user, pass));
  }
  lc.login();
  return lc;
}
origin: org.jboss.jbossas/jboss-as-server

UsernamePasswordHandler handler = new UsernamePasswordHandler(username,
 credentials);
Configuration conf = getConfiguration();
origin: stackoverflow.com

UsernamePasswordHandler handler = new UsernamePasswordHandler("your-uid", "your-uid-password".toCharArray());
LoginContext lc = new LoginContext("testLdapExample1", handler);
lc.login();
org.jboss.security.auth.callbackUsernamePasswordHandler<init>

Javadoc

Initialize the UsernamePasswordHandler with the usernmae and password to use.

Popular methods of UsernamePasswordHandler

    Popular in Java

    • Reactive rest calls using spring rest template
    • setContentView (Activity)
    • startActivity (Activity)
    • compareTo (BigDecimal)
    • ResultSet (java.sql)
      An interface for an object which represents a database table entry, returned as the result of the qu
    • SimpleDateFormat (java.text)
      Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
    • Enumeration (java.util)
      A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
    • Collectors (java.util.stream)
    • JTextField (javax.swing)
    • Project (org.apache.tools.ant)
      Central representation of an Ant project. This class defines an Ant project with all of its targets,
    • Top 17 Free Sublime Text Plugins
    Tabnine Logo
    • Products

      Search for Java codeSearch for JavaScript code
    • IDE Plugins

      IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Tabnine for your IDE now