本文整理了Java中org.openid4java.message.Message.hasExtension()
方法的一些代码示例,展示了Message.hasExtension()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.hasExtension()
方法的具体详情如下:
包路径:org.openid4java.message.Message
类名称:Message
方法名:hasExtension
[英]Returns true if the message has parameters for the specified extension type URI.
[中]如果消息具有指定扩展类型URI的参数,则返回true。
代码示例来源:origin: spring-projects/spring-security
|| !authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
return Collections.emptyList();
代码示例来源:origin: spring-projects/spring-security
@Test
public void fetchAttributesReturnsExpectedValues() throws Exception {
OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(
new NullAxFetchListFactory());
Message msg = mock(Message.class);
FetchResponse fr = mock(FetchResponse.class);
when(msg.hasExtension(AxMessage.OPENID_NS_AX)).thenReturn(true);
when(msg.getExtension(AxMessage.OPENID_NS_AX)).thenReturn(fr);
when(fr.getAttributeValues("a")).thenReturn(Arrays.asList("x", "y"));
List<OpenIDAttribute> fetched = consumer.fetchAxAttributes(msg, attributes);
assertThat(fetched).hasSize(1);
assertThat(fetched.get(0).getValues()).hasSize(2);
}
代码示例来源:origin: spring-projects/spring-security
@Test(expected = OpenIDConsumerException.class)
public void messageExceptionFetchingAttributesRaisesOpenIDException()
throws Exception {
OpenID4JavaConsumer consumer = new OpenID4JavaConsumer(
new NullAxFetchListFactory());
Message msg = mock(Message.class);
FetchResponse fr = mock(FetchResponse.class);
when(msg.hasExtension(AxMessage.OPENID_NS_AX)).thenReturn(true);
when(msg.getExtension(AxMessage.OPENID_NS_AX))
.thenThrow(new MessageException(""));
when(fr.getAttributeValues("a")).thenReturn(Arrays.asList("x", "y"));
consumer.fetchAxAttributes(msg, attributes);
}
代码示例来源:origin: org.springframework.security/spring-security-openid
|| !authSuccess.hasExtension(AxMessage.OPENID_NS_AX)) {
return Collections.emptyList();
代码示例来源:origin: org.openid4java/openid4java-nodeps
if (hasExtension(extensionTypeUri))
代码示例来源:origin: jbufu/openid4java
if (hasExtension(extensionTypeUri))
代码示例来源:origin: be.fedict.eid-idp/eid-idp-sp-protocol-openid
if (authResponse.hasExtension(AxMessage.OPENID_NS_AX)) {
if (authResponse.hasExtension(PapeResponse.OPENID_NS_PAPE)) {
代码示例来源:origin: org.openid4java/openid4java
if (hasExtension(extensionTypeUri))
代码示例来源:origin: com.cloudbees/openid4java-shaded
if (hasExtension(extensionTypeUri))
代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps
ParameterList extension = new ParameterList();
if (hasExtension(extensionTypeUri)) {
String extensionAlias = getExtensionAlias(extensionTypeUri);
代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps
String typeUri = extension.getTypeUri();
if (hasExtension(typeUri)) {
throw new MessageException("Extension already present: " + typeUri);
代码示例来源:origin: org.openid4java/openid4java
if (hasExtension(typeUri))
throw new MessageException("Extension already present: " + typeUri);
代码示例来源:origin: org.openid4java/openid4java-nodeps
if (hasExtension(typeUri))
throw new MessageException("Extension already present: " + typeUri);
代码示例来源:origin: jbufu/openid4java
if (hasExtension(typeUri))
throw new MessageException("Extension already present: " + typeUri);
代码示例来源:origin: com.cloudbees/openid4java-shaded
if (hasExtension(typeUri))
throw new MessageException("Extension already present: " + typeUri);
内容来源于网络,如有侵权,请联系作者删除!