2014-08-01 10:34:47 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Copyright the original author or authors
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
package org.jivesoftware.smack.sasl.javax;
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
import javax.security.sasl.Sasl;
|
|
|
|
|
|
|
|
/**
|
2015-03-29 12:15:32 +02:00
|
|
|
* Implementation of the SASL GSSAPI mechanism.
|
2014-08-01 10:34:47 +02:00
|
|
|
*
|
|
|
|
* @author Jay Kline
|
|
|
|
*/
|
|
|
|
public class SASLGSSAPIMechanism extends SASLJavaXMechanism {
|
|
|
|
|
|
|
|
public static final String NAME = GSSAPI;
|
|
|
|
|
2015-06-16 18:50:30 +02:00
|
|
|
@Override
|
|
|
|
public boolean authzidSupported() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2014-08-01 10:34:47 +02:00
|
|
|
@Override
|
|
|
|
public String getName() {
|
|
|
|
return NAME;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
protected Map<String, String> getSaslProps() {
|
|
|
|
Map<String, String> props = super.getSaslProps();
|
2019-05-17 21:56:46 +02:00
|
|
|
props.put(Sasl.SERVER_AUTH, "TRUE");
|
2014-08-01 10:34:47 +02:00
|
|
|
return props;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GSSAPI differs from all other SASL mechanism such that it required the FQDN host name as
|
|
|
|
* server name and not the serviceName (At least that is what old code comments of Smack tell
|
|
|
|
* us).
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
protected String getServerName() {
|
|
|
|
return host;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getPriority() {
|
|
|
|
return 100;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public SASLGSSAPIMechanism newInstance() {
|
|
|
|
return new SASLGSSAPIMechanism();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|