Examples of AuthMethod


Examples of org.apache.hadoop.security.SaslRpcServer.AuthMethod

     @Override
     public TTransport createClientTransport(
       String principalConfig, String host,
        String methodStr, String tokenStrForm, TTransport underlyingTransport)
       throws IOException {
       AuthMethod method = AuthMethod.valueOf(AuthMethod.class, methodStr);

       TTransport saslTransport = null;
       switch (method) {
         case DIGEST:
           Token<DelegationTokenIdentifier> t= new Token<DelegationTokenIdentifier>();
           t.decodeFromUrlString(tokenStrForm);
           saslTransport = new TSaslClientTransport(
            method.getMechanismName(),
            null,
            null, SaslRpcServer.SASL_DEFAULT_REALM,
            SaslRpcServer.SASL_PROPS, new SaslClientCallbackHandler(t),
            underlyingTransport);
           return new TUGIAssumingTransport(saslTransport, UserGroupInformation.getCurrentUser());

         case KERBEROS:
           String serverPrincipal = SecurityUtil.getServerPrincipal(principalConfig, host);
           String names[] = SaslRpcServer.splitKerberosName(serverPrincipal);
           if (names.length != 3) {
             throw new IOException(
               "Kerberos principal name does NOT have the expected hostname part: "
                 + serverPrincipal);
           }
           try {
             saslTransport = new TSaslClientTransport(
               method.getMechanismName(),
               null,
               names[0], names[1],
               SaslRpcServer.SASL_PROPS, null,
               underlyingTransport);
             return new TUGIAssumingTransport(saslTransport, UserGroupInformation.getCurrentUser());
View Full Code Here

Examples of org.apache.hadoop.security.SaslRpcServer.AuthMethod

     */
    public TTransport createClientTransport(
      String principalConfig, String host,
      String methodStr, TTransport underlyingTransport)
      throws IOException, IllegalAccessException {
      AuthMethod method = AuthMethod.valueOf(AuthMethod.class, methodStr);

      switch (method) {
        case KERBEROS:
          String serverPrincipal = SecurityUtil.getServerPrincipal(principalConfig, host);
          String names[] = SaslRpcServer.splitKerberosName(serverPrincipal);
          if (names.length != 3) {
            throw new IOException(
              "Kerberos principal name not in the format service/host@REALM: "
              + serverPrincipal);
          }
          try {
            Map<String, String> reflectedProps = new TreeMap<String, String>();
            reflectedProps = (java.util.Map)SASL_PROPS_FIELD.get("");         
            TTransport saslTransport = new TSaslClientTransport(
              method.getMechanismName(),
              null,
              names[0], names[1],
              reflectedProps, null,
              underlyingTransport);

View Full Code Here

Examples of org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod

                            Set<String> contacts = readSet(reader);
                            client.setContacts(contacts);
                        } else if (name.equals("tosUri")) {
                            client.setTosUri(reader.nextString());
                        } else if (name.equals("tokenEndpointAuthMethod")) {
                            AuthMethod am = AuthMethod.getByValue(reader.nextString());
                            client.setTokenEndpointAuthMethod(am);
                        } else if (name.equals("grantTypes")) {
                            Set<String> grantTypes = readSet(reader);
                            client.setGrantTypes(grantTypes);
                        } else if (name.equals("responseTypes")) {
View Full Code Here

Examples of org.mitre.oauth2.model.ClientDetailsEntity.AuthMethod

                            Set<String> contacts = readSet(reader);
                            client.setContacts(contacts);
                        } else if (name.equals("tosUri")) {
                            client.setTosUri(reader.nextString());
                        } else if (name.equals("tokenEndpointAuthMethod")) {
                            AuthMethod am = AuthMethod.getByValue(reader.nextString());
                            client.setTokenEndpointAuthMethod(am);
                        } else if (name.equals("grantTypes")) {
                            Set<String> grantTypes = readSet(reader);
                            client.setGrantTypes(grantTypes);
                        } else if (name.equals("responseTypes")) {
View Full Code Here

Examples of org.reficio.ws.client.core.SoapConstants.AuthMethod

        }
    }

    private void configureAuthentication(Security.Builder builder) {
        if(authMethod != null) {
            AuthMethod method = AuthMethod.valueOf(authMethod);
            if(method.equals(AuthMethod.BASIC)) {
                builder.authBasic(authUsername, authPassword);
            } else if(method.equals(AuthMethod.DIGEST)) {
                builder.authDigest(authUsername, authPassword);
            } else if(method.equals(AuthMethod.NTLM)) {
                builder.authNtlm(authUsername, authPassword, authWorkstation, authDomain);
            } else if(method.equals(AuthMethod.SPNEGO)) {
                builder.authSpnego();
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.