本文整理匯總了Java中org.opensaml.saml.saml2.metadata.impl.SingleSignOnServiceBuilder類的典型用法代碼示例。如果您正苦於以下問題:Java SingleSignOnServiceBuilder類的具體用法?Java SingleSignOnServiceBuilder怎麽用?Java SingleSignOnServiceBuilder使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SingleSignOnServiceBuilder類屬於org.opensaml.saml.saml2.metadata.impl包,在下文中一共展示了SingleSignOnServiceBuilder類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSingleSignOn
import org.opensaml.saml.saml2.metadata.impl.SingleSignOnServiceBuilder; //導入依賴的package包/類
@Test
public void getSingleSignOn() throws Exception {
// Given
SingleSignOnServiceBuilder singleSignOnServiceBuilder = new SingleSignOnServiceBuilder();
SingleSignOnService singleSignOnService = singleSignOnServiceBuilder.buildObject();
singleSignOnService.setLocation("http://the-sso-location");
IDPSSODescriptorBuilder idpssoDescriptorBuilder = new IDPSSODescriptorBuilder();
IDPSSODescriptor idpssoDescriptor = idpssoDescriptorBuilder.buildObject();
idpssoDescriptor.getSingleSignOnServices().add(singleSignOnService);
idpssoDescriptor.addSupportedProtocol(SAMLConstants.SAML20P_NS);
EntityDescriptorBuilder entityDescriptorBuilder = new EntityDescriptorBuilder();
EntityDescriptor entityDescriptor = entityDescriptorBuilder.buildObject();
entityDescriptor.setEntityID("the-entity-id");
entityDescriptor.getRoleDescriptors().add(idpssoDescriptor);
when(metadataResolver.resolveSingle(new CriteriaSet(new EntityIdCriterion(entityDescriptor.getEntityID())))).thenReturn(entityDescriptor);
// When
URI singleSignOnUri = service.getSingleSignOn(entityDescriptor.getEntityID());
// Then
assertThat(singleSignOnUri.toString(), equalTo(singleSignOnService.getLocation()));
verify(metadataResolver).resolveSingle(any(CriteriaSet.class));
}
示例2: getSsoService
import org.opensaml.saml.saml2.metadata.impl.SingleSignOnServiceBuilder; //導入依賴的package包/類
private SingleSignOnService getSsoService() {
SingleSignOnService singleSignOnService = new SingleSignOnServiceBuilder().buildObject();
singleSignOnService.setBinding(SAMLConstants.SAML2_POST_BINDING_URI);
singleSignOnService.setLocation(matchingServiceAdapterConfiguration.getHubSSOUri().toString());
return singleSignOnService;
}
開發者ID:alphagov,項目名稱:verify-matching-service-adapter,代碼行數:9,代碼來源:MatchingServiceAdapterMetadataRepository.java