本文整理汇总了Java中javax.naming.AuthenticationNotSupportedException类的典型用法代码示例。如果您正苦于以下问题:Java AuthenticationNotSupportedException类的具体用法?Java AuthenticationNotSupportedException怎么用?Java AuthenticationNotSupportedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AuthenticationNotSupportedException类属于javax.naming包,在下文中一共展示了AuthenticationNotSupportedException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: test_valueAuthMech_none
import javax.naming.AuthenticationNotSupportedException; //导入依赖的package包/类
public void test_valueAuthMech_none()
throws AuthenticationNotSupportedException {
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.None, sbind.getAuthMech());
env.put(Context.SECURITY_CREDENTIALS, "test_credentials");
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.None, sbind.getAuthMech());
env.clear();
env.put(Context.SECURITY_AUTHENTICATION, "none");
env.put(Context.SECURITY_PRINCIPAL, "test_principal");
env.put(Context.SECURITY_CREDENTIALS, "test_credentials");
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.None, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION, "NoNe");
assertEquals(SaslBind.AuthMech.None, sbind.getAuthMech());
}
开发者ID:shannah,项目名称:cn1,代码行数:20,代码来源:SaslBindTest.java
示例2: test_valueAuthMech_SASL
import javax.naming.AuthenticationNotSupportedException; //导入依赖的package包/类
public void test_valueAuthMech_SASL()
throws AuthenticationNotSupportedException {
env.put(Context.SECURITY_AUTHENTICATION, DIGEST_MD5);
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.SASL, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION, CRAM_MD5);
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.SASL, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION, GSSAPI);
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.SASL, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION, EXTERNAL);
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.SASL, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION,
" test test2 EXTERNAL test3 GSSAPI");
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.SASL, sbind.getAuthMech());
}
开发者ID:shannah,项目名称:cn1,代码行数:24,代码来源:SaslBindTest.java
示例3: assignUser
import javax.naming.AuthenticationNotSupportedException; //导入依赖的package包/类
@Secured(ROLE_ADMIN)
@RequestMapping(value = "/users/{organisationId}", method = RequestMethod.POST)
public void assignUser(@RequestParam("username") String username, @PathVariable("organisationId") Long id)
throws AuthenticationNotSupportedException {
if (!securityService.assignToOrganisation(username, id)) {
throw new AuthenticationNotSupportedException("Could not attach user to organisation.");
}
}
开发者ID:gjong,项目名称:web-harvester,代码行数:9,代码来源:StatusController.java
示例4: externalValueAuthMech
import javax.naming.AuthenticationNotSupportedException; //导入依赖的package包/类
private AuthMech externalValueAuthMech(Hashtable env)
throws AuthenticationNotSupportedException {
if (env == null) {
// FIXME: handle exception here?
return null;
}
if (env.get(Context.SECURITY_AUTHENTICATION) == null) {
if (env.get(Context.SECURITY_PRINCIPAL) == null) {
this.authMech = AuthMech.None;
} else {
this.authMech = AuthMech.Simple;
}
} else if (((String) env.get(Context.SECURITY_AUTHENTICATION))
.equalsIgnoreCase("none")) {
this.authMech = AuthMech.None;
} else if (((String) env.get(Context.SECURITY_AUTHENTICATION))
.equalsIgnoreCase("simple")) {
this.authMech = AuthMech.Simple;
} else if (valueSaslMech((String) env
.get(Context.SECURITY_AUTHENTICATION))) {
this.authMech = AuthMech.SASL;
} else {
throw new AuthenticationNotSupportedException((String) env
.get(Context.SECURITY_AUTHENTICATION));
}
return this.authMech;
}
开发者ID:shannah,项目名称:cn1,代码行数:30,代码来源:SaslBind.java
示例5: test_valueAuthMech_simple
import javax.naming.AuthenticationNotSupportedException; //导入依赖的package包/类
public void test_valueAuthMech_simple()
throws AuthenticationNotSupportedException {
env.put(Context.SECURITY_PRINCIPAL, "test_principal");
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.Simple, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION, "simple");
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.Simple, sbind.getAuthMech());
env.put(Context.SECURITY_AUTHENTICATION, "SiMpLe");
sbind.valueAuthMech(env);
assertEquals(SaslBind.AuthMech.Simple, sbind.getAuthMech());
}
开发者ID:shannah,项目名称:cn1,代码行数:15,代码来源:SaslBindTest.java
示例6: valueAuthMech
import javax.naming.AuthenticationNotSupportedException; //导入依赖的package包/类
public AuthMech valueAuthMech(Hashtable env)
throws AuthenticationNotSupportedException {
return externalValueAuthMech(env);
}
开发者ID:shannah,项目名称:cn1,代码行数:5,代码来源:SaslBind.java
注:本文中的javax.naming.AuthenticationNotSupportedException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论