當前位置: 首頁>>代碼示例>>Java>>正文


Java SingleSignOnServiceBuilder類代碼示例

本文整理匯總了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));
}
 
開發者ID:alphagov,項目名稱:verify-hub,代碼行數:27,代碼來源:CountrySingleSignOnServiceHelperTest.java

示例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


注:本文中的org.opensaml.saml.saml2.metadata.impl.SingleSignOnServiceBuilder類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。