本文整理汇总了Java中javax.security.auth.message.config.ClientAuthConfig类的典型用法代码示例。如果您正苦于以下问题:Java ClientAuthConfig类的具体用法?Java ClientAuthConfig怎么用?Java ClientAuthConfig使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClientAuthConfig类属于javax.security.auth.message.config包,在下文中一共展示了ClientAuthConfig类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
/**
* @see AuthConfigProvider#getClientAuthConfig(String, String, CallbackHandler)
*/
public ClientAuthConfig getClientAuthConfig(String layer, String appContext,
CallbackHandler handler) throws AuthException
{
//TODO: Throw SecurityException if user has no perms
if(handler == null)
{
try
{
handler = this.instantiateCallbackHandler();
}
catch(Exception e)
{
throw new AuthException(e.getLocalizedMessage());
}
}
return new JBossClientAuthConfig(layer,appContext, handler, contextProperties);
}
示例2: testClientFactoryConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void testClientFactoryConfig() throws Exception
{
assertNotNull("AuthConfigFactory is ! null", factory);
AuthConfigProvider provider = factory.getConfigProvider("TEST", "APP", null);
assertNotNull("AuthConfigProvider is ! null", provider);
ClientAuthConfig clientConfig =
provider.getClientAuthConfig("TEST", "APP",
new AppCallbackHandler("anil","anil".toCharArray()));
assertNotNull("ClientAuthConfig ! null", clientConfig);
MessageInfo mi = new GenericMessageInfo(new Object(), new Object());
String authContextID = clientConfig.getAuthContextID(mi);
assertNotNull("AuthContext ID != null",authContextID);
ClientAuthContext sctx = clientConfig.getAuthContext(authContextID,
new Subject(), new HashMap());
assertNotNull("ClientAuthContext != null",sctx);
}
示例3: JaspiClientAuthenticator
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
public JaspiClientAuthenticator(ClientAuthConfig clientConfig, String securityDomain, JASPIAuthenticationInfo jpi)
{
this.clientConfig = clientConfig;
this.securityDomain = securityDomain;
this.jpi = jpi;
}
示例4: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
/**
* There is no client side module.
*
* @return <code>null</code>
*/
@Override
public ClientAuthConfig getClientAuthConfig(final String layer,
final String appContext,
final CallbackHandler handler) throws AuthException {
return null;
}
示例5: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@Override
public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler callbackHandler) throws AuthException {
return null;
}
示例6: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@Override
public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler)
throws AuthException, SecurityException {
return null;
}
示例7: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@Override
public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler)
throws AuthException, SecurityException
{
return new JBossWSClientAuthConfig(layer, appContext, handler, contextProperties);
}
示例8: enableClientAuthentication
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
public boolean enableClientAuthentication(Object target, Map<String, String> properties)
{
if (!(target instanceof Client)) {
Loggers.ROOT_LOGGER.cannotEnableJASPIAuthentication(target.getClass().getSimpleName());
return false;
}
Client client = (Client)target;
String securityDomain = properties.get(JaspiClientAuthenticator.JASPI_SECURITY_DOMAIN);
if (securityDomain == null)
{
return false;
}
ApplicationPolicy appPolicy = SecurityConfiguration.getApplicationPolicy(securityDomain);
if (appPolicy == null)
{
Loggers.ROOT_LOGGER.noApplicationPolicy(securityDomain);
return false;
}
BaseAuthenticationInfo bai = appPolicy.getAuthenticationInfo();
if (bai == null || bai instanceof AuthenticationInfo)
{
Loggers.ROOT_LOGGER.noJaspiApplicationPolicy(securityDomain);
return false;
}
JASPIAuthenticationInfo jai = (JASPIAuthenticationInfo) bai;
String contextRoot = client.getEndpoint().getEndpointInfo().getName().toString();
String appId = "localhost " + contextRoot;
AuthConfigFactory factory = AuthConfigFactory.getFactory();
Properties props = new Properties();
AuthConfigProvider provider = new JBossWSAuthConfigProvider(props, factory);
provider = factory.getConfigProvider(JBossWSAuthConstants.SOAP_LAYER, appId, null);
JBossCallbackHandler callbackHandler = new JBossCallbackHandler();
try
{
ClientAuthConfig clientConfig = provider.getClientAuthConfig("soap", appId, callbackHandler);
JaspiClientAuthenticator clientAuthenticator = new JaspiClientAuthenticator(clientConfig, securityDomain, jai);
client.getInInterceptors().add(new JaspiClientInInterceptor(clientAuthenticator));
client.getOutInterceptors().add(new JaspiClientOutInterceptor(clientAuthenticator));
}
catch (Exception e)
{
Loggers.DEPLOYMENT_LOGGER.cannotCreateServerAuthContext(securityDomain, e);
}
return false;
}
示例9: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
public ClientAuthConfig getClientAuthConfig(String layer,
String appcontext, CallbackHandler handler) throws AuthException,
SecurityException
{
return new TestClientAuthConfig();
}
示例10: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@Override
public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException,
SecurityException {
return null;
}
示例11: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@Override
public ClientAuthConfig getClientAuthConfig(String layer,
String appContext, CallbackHandler handler) throws AuthException,
SecurityException {
return null;
}
示例12: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
@Override
public ClientAuthConfig getClientAuthConfig(String layer, String appContext, CallbackHandler handler) throws AuthException, SecurityException {
return null;
}
示例13: getClientAuthConfig
import javax.security.auth.message.config.ClientAuthConfig; //导入依赖的package包/类
/**
* <p>
* Client authentication is not provided.
* </p>
* {@inheritDoc}
*
* @return <code>null</code>
*/
@Override
public ClientAuthConfig getClientAuthConfig(final String layer,
final String appContext,
final CallbackHandler handler) throws AuthException {
return null;
}