Codota Logo
Sasl.createSaslServer
Code IndexAdd Codota to your IDE (free)

How to use
createSaslServer
method
in
javax.security.sasl.Sasl

Best Java code snippets using javax.security.sasl.Sasl.createSaslServer (Showing top 20 results out of 423)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: apache/avro

 public SaslServer getServer() throws SaslException {
  return Sasl.createSaslServer(mechanism, protocol, serverName,
                props, cbh);
 }
});
origin: apache/zookeeper

  public SaslServer run() {
    try {
      SaslServer saslServer;
      saslServer = Sasl.createSaslServer(
          mech, servicePrincipalName,
          serviceHostname, null,
          callbackHandler);
      return saslServer;
    } catch (SaslException e) {
      LOG.error("Zookeeper Server failed to create a SaslServer to interact with a client during session initiation: ", e);
      return null;
    }
  }
});
origin: apache/storm

  public SaslServer run() {
    try {
      Map<String, String> props = new TreeMap<String, String>();
      props.put(Sasl.QOP, "auth");
      props.put(Sasl.SERVER_AUTH, "false");
      return Sasl.createSaslServer(SaslUtils.KERBEROS,
                     fServiceName,
                     fHost, props, fch);
    } catch (Exception e) {
      LOG.error("Subject failed to create sasl server.", e);
      return null;
    }
  }
});
origin: org.apache.zookeeper/zookeeper

  public SaslServer run() {
    try {
      SaslServer saslServer;
      saslServer = Sasl.createSaslServer(
          mech, servicePrincipalName,
          serviceHostname, null,
          callbackHandler);
      return saslServer;
    } catch (SaslException e) {
      LOG.error("Zookeeper Server failed to create a SaslServer to interact with a client during session initiation: ", e);
      return null;
    }
  }
});
origin: apache/kafka

private void createSaslServer(String mechanism) throws IOException {
  this.saslMechanism = mechanism;
  Subject subject = subjects.get(mechanism);
  final AuthenticateCallbackHandler callbackHandler = callbackHandlers.get(mechanism);
  if (mechanism.equals(SaslConfigs.GSSAPI_MECHANISM)) {
    saslServer = createSaslKerberosServer(callbackHandler, configs, subject);
  } else {
    try {
      saslServer = Subject.doAs(subject, (PrivilegedExceptionAction<SaslServer>) () ->
        Sasl.createSaslServer(saslMechanism, "kafka", serverAddress().getHostName(), configs, callbackHandler));
    } catch (PrivilegedActionException e) {
      throw new SaslException("Kafka Server failed to create a SaslServer to interact with a client during session authentication", e.getCause());
    }
  }
}
origin: apache/storm

SaslNettyServer(String topologyName, byte[] token) throws IOException {
  LOG.debug("SaslNettyServer: Topology token is: {} with authmethod {}",
       topologyName, SaslUtils.AUTH_DIGEST_MD5);
  try {
    SaslDigestCallbackHandler ch = new SaslNettyServer.SaslDigestCallbackHandler(
      topologyName, token);
    saslServer = Sasl.createSaslServer(SaslUtils.AUTH_DIGEST_MD5, null,
                      SaslUtils.DEFAULT_REALM,
                      SaslUtils.getSaslProps(), ch);
  } catch (SaslException e) {
    LOG.error("SaslNettyServer: Could not create SaslServer: ", e);
  }
}
origin: apache/hbase

 @Override
 public SaslServer run() throws SaslException {
  return Sasl.createSaslServer(AuthMethod.KERBEROS.getMechanismName(), names[0],
   names[1], saslProps, new SaslGssCallbackHandler());
 }
});
origin: Alluxio/alluxio

 @Override
 public SaslServer createSaslServer(Runnable runnable, String serverName,
   AlluxioConfiguration conf) throws SaslException {
  AuthType authType =
    conf.getEnum(PropertyKey.SECURITY_AUTHENTICATION_TYPE, AuthType.class);
  AuthenticationProvider provider = AuthenticationProvider.Factory.create(authType, conf);
  return Sasl.createSaslServer(PlainSaslServerProvider.MECHANISM, null, serverName,
    new HashMap<String, String>(), new PlainSaslServerCallbackHandler(provider, runnable,
      conf));
 }
}
origin: apache/hive

SaslServerHandler(RpcConfiguration config) throws IOException {
 super(config);
 this.server = Sasl.createSaslServer(config.getSaslMechanism(), Rpc.SASL_PROTOCOL,
  Rpc.SASL_REALM, config.getSaslOptions(), this);
}
origin: apache/zookeeper

SaslServer saslServer = Sasl.createSaslServer("DIGEST-MD5",
    protocol, serverName, null, callbackHandler);
return saslServer;
origin: apache/hbase

 throw new AccessDeniedException("Server is not configured to do DIGEST authentication.");
saslServer = Sasl.createSaslServer(AuthMethod.DIGEST.getMechanismName(), null,
 SaslUtil.SASL_DEFAULT_REALM, saslProps, new SaslDigestCallbackHandler(secretManager));
break;
origin: apache/kafka

      Sasl.createSaslServer(saslMechanism, servicePrincipalName, serviceHostname, configs, saslServerCallbackHandler));
} catch (PrivilegedActionException e) {
  throw new SaslException("Kafka Server failed to create a SaslServer to interact with a client during session authentication", e.getCause());
origin: Alluxio/alluxio

 /**
  * Tests the {@link Sasl#createSaslServer(String, String, String, Map, CallbackHandler)} method to
  * be null when the provider is not plain.
  */
 @Test
 public void createNoSupportSaslServer() throws Exception {
  // create a SaslServer which SecurityProvider has not supported
  SaslServer server = Sasl.createSaslServer("NO_PLAIN", "", "",
    new HashMap<String, String>(), null);
  Assert.assertNull(server);
 }
}
origin: org.apache.zookeeper/zookeeper

SaslServer saslServer = Sasl.createSaslServer("DIGEST-MD5",
    protocol, serverName, null, callbackHandler);
return saslServer;
origin: Alluxio/alluxio

/**
 * Tests the {@link Sasl#createSaslServer(String, String, String, Map, CallbackHandler)} method to
 * work with the {@link PlainSaslServerProvider#MECHANISM} successfully.
 */
@Test
public void createPlainSaslServer() throws Exception {
 // create plainSaslServer
 SaslServer server = Sasl.createSaslServer(PlainSaslServerProvider.MECHANISM, "", "",
   new HashMap<String, String>(), null);
 Assert.assertNotNull(server);
 Assert.assertEquals(PlainSaslServerProvider.MECHANISM, server.getMechanismName());
}
origin: igniterealtime/Openfire

props.put( "com.sun.security.sasl.digest.realm", serverInfo.getXMPPDomain() );
SaslServer saslServer = Sasl.createSaslServer( mechanismName, "xmpp", serverName, props, new XMPPCallbackHandler() );
if ( saslServer == null )
origin: apache/tinkerpop

Krb5SaslAuthenticator() {
  try {
    // For sasl properties regarding GSSAPI, see:
    //   https://docs.oracle.com/javase/8/docs/technotes/guides/security/sasl/sasl-refguide.html#SERVER
    // Rely on GSSAPI defaults for Sasl.MAX_BUFFER and Sasl.QOP. Note, however, that gremlin-driver has
    // Sasl.SERVER_AUTH fixed to true (mutual authentication) and one can configure SSL for enhanced confidentiality,
    // Sasl policy properties for negotiating the authenticatin mechanism are not relevant here, because
    // GSSAPI is the only available mechanism for this authenticator
    final Map props = new HashMap<String, Object>();
    final String[] principalParts = principalName.split("/|@");
    if (principalParts.length < 3) throw new IllegalArgumentException("Use principal name of format 'service/fqdn@kdcrealm'");
    saslServer = Sasl.createSaslServer(mechanism, principalParts[0], principalParts[1], props, Krb5SaslAuthenticator.this);
  } catch(Exception e) {
    logger.error("Creating sasl server failed: ", e);
  }
  logger.debug("SaslServer created with: " + saslServer.getMechanismName());
}
origin: org.apache.thrift/libthrift

/**
 * Performs the server side of the initial portion of the Thrift SASL protocol.
 * Receives the initial response from the client, creates a SASL server using
 * the mechanism requested by the client (if this server supports it), and
 * sends the first challenge back to the client.
 */
@Override
protected void handleSaslStartMessage() throws TTransportException, SaslException {
 SaslResponse message = receiveSaslMessage();
 LOGGER.debug("Received start message with status {}", message.status);
 if (message.status != NegotiationStatus.START) {
  throw sendAndThrowMessage(NegotiationStatus.ERROR, "Expecting START status, received " + message.status);
 }
 // Get the mechanism name.
 String mechanismName;
 try {
   mechanismName = new String(message.payload, "UTF-8");
 } catch (UnsupportedEncodingException e) {
   throw new TTransportException("JVM DOES NOT SUPPORT UTF-8");
  }
 TSaslServerDefinition serverDefinition = serverDefinitionMap.get(mechanismName);
 LOGGER.debug("Received mechanism name '{}'", mechanismName);
 if (serverDefinition == null) {
  throw sendAndThrowMessage(NegotiationStatus.BAD, "Unsupported mechanism type " + mechanismName);
 }
 SaslServer saslServer = Sasl.createSaslServer(serverDefinition.mechanism,
   serverDefinition.protocol, serverDefinition.serverName, serverDefinition.props,
   serverDefinition.cbh);
 setSaslServer(saslServer);
}
origin: org.apache.directory.server/apacheds-protocol-ldap

  public SaslServer run() throws Exception
  {
    return Sasl.createSaslServer( SupportedSaslMechanisms.GSSAPI, SaslConstants.LDAP_PROTOCOL,
      saslHost, saslProps, callbackHandler );
  }
} );
origin: org.apache.avro/avro-ipc

 public SaslServer getServer() throws SaslException {
  return Sasl.createSaslServer(mechanism, protocol, serverName,
                props, cbh);
 }
});
javax.security.saslSaslcreateSaslServer

Popular methods of Sasl

  • createSaslClient
  • getSaslServerFactories
  • getSaslClientFactories

Popular in Java

  • Making http post requests using okhttp
  • onCreateOptionsMenu (Activity)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JFileChooser (javax.swing)
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