当前位置: 首页>>代码示例>>Java>>正文


Java SingleSignOnService类代码示例

本文整理汇总了Java中org.opensaml.saml2.metadata.SingleSignOnService的典型用法代码示例。如果您正苦于以下问题:Java SingleSignOnService类的具体用法?Java SingleSignOnService怎么用?Java SingleSignOnService使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SingleSignOnService类属于org.opensaml.saml2.metadata包,在下文中一共展示了SingleSignOnService类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processChildElement

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
    IDPSSODescriptor descriptor = (IDPSSODescriptor) parentObject;

    if (childObject instanceof SingleSignOnService) {
        descriptor.getSingleSignOnServices().add((SingleSignOnService) childObject);
    } else if (childObject instanceof NameIDMappingService) {
        descriptor.getNameIDMappingServices().add((NameIDMappingService) childObject);
    } else if (childObject instanceof AssertionIDRequestService) {
        descriptor.getAssertionIDRequestServices().add((AssertionIDRequestService) childObject);
    } else if (childObject instanceof AttributeProfile) {
        descriptor.getAttributeProfiles().add((AttributeProfile) childObject);
    } else if (childObject instanceof Attribute) {
        descriptor.getAttributes().add((Attribute) childObject);
    } else {
        super.processChildElement(parentObject, childObject);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:IDPSSODescriptorUnmarshaller.java

示例2: IDPSSODescriptorImpl

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/**
 * Constructor.
 * 
 * @param namespaceURI the namespace the element is in
 * @param elementLocalName the local name of the XML element this Object represents
 * @param namespacePrefix the prefix for the given namespace
 */
protected IDPSSODescriptorImpl(String namespaceURI, String elementLocalName, String namespacePrefix) {
    super(namespaceURI, elementLocalName, namespacePrefix);
    singleSignOnServices = new XMLObjectChildrenList<SingleSignOnService>(this);
    nameIDMappingServices = new XMLObjectChildrenList<NameIDMappingService>(this);
    assertionIDRequestServices = new XMLObjectChildrenList<AssertionIDRequestService>(this);
    attributeProfiles = new XMLObjectChildrenList<AttributeProfile>(this);
    attributes = new XMLObjectChildrenList<Attribute>(this);
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:IDPSSODescriptorImpl.java

示例3: getEndpoints

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
public List<Endpoint> getEndpoints(QName type) {
    if(type.equals(SingleSignOnService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(singleSignOnServices));
    }else if(type.equals(NameIDMappingService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(nameIDMappingServices));
    }else if(type.equals(AssertionIDRequestService.DEFAULT_ELEMENT_NAME)){
        return Collections.unmodifiableList(new ArrayList<Endpoint>(assertionIDRequestServices));
    }else{
        return super.getEndpoints(type);
    }
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:13,代码来源:IDPSSODescriptorImpl.java

示例4: getSingleSignOnService

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private SingleSignOnService getSingleSignOnService(final SAMLConfig configuration, final String binding) {
	SAMLObjectBuilder<SingleSignOnService> builder = (SAMLObjectBuilder<SingleSignOnService>) builderFactory.getBuilder(SingleSignOnService.DEFAULT_ELEMENT_NAME);
	SingleSignOnService service = builder.buildObject();
	service.setBinding(binding);
	service.setLocation(configuration.getLoginUrl());

	return service;
}
 
开发者ID:italia,项目名称:spid-spring,代码行数:10,代码来源:IdpMetadataGenerator.java

示例5: getPostBinding

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
private static SingleSignOnService getPostBinding(IDPSSODescriptor idpSsoDescriptor)
    throws SamlException {
  return idpSsoDescriptor
      .getSingleSignOnServices()
      .stream()
      .filter(x -> x.getBinding().equals("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"))
      .findAny()
      .orElseThrow(() -> new SamlException("Cannot find HTTP-POST SSO binding in metadata"));
}
 
开发者ID:coveo,项目名称:saml-client,代码行数:10,代码来源:SamlClient.java

示例6: getSingleSignonServiceLocation

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/**
 * Get a signon service location for a specific binding.
 * @param binding SAML binding name,
 * @return The url for the location.
 * @throws IllegalArgumentException if the binding is not present in metadata.
 */
public String getSingleSignonServiceLocation(String binding) throws IllegalArgumentException {
	for (SingleSignOnService service : idpSSODescriptor.getSingleSignOnServices()) {
		if (service.getBinding().equals(binding)) {
			return service.getLocation();
		}
	}
	throw new IllegalArgumentException("Binding " + binding + " not found");
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:15,代码来源:IdpMetadata.java

示例7: findLoginEndpoint

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/**
 * Find a supported login endpoint.
 * @throws IllegalArgumentException If no services match the selected bindings. 
 */
public Endpoint findLoginEndpoint(String[] bindings) {
	if (bindings == null) throw new IllegalArgumentException("bindings cannot be null");
	
	for (String binding : bindings) {
		for (SingleSignOnService service : idpSSODescriptor.getSingleSignOnServices()) {
			if (service.getBinding().equalsIgnoreCase(binding)) {
				return service;
			}
		}
	}
	throw new IllegalArgumentException("No SingleSignonService found for " + Arrays.toString(bindings));
}
 
开发者ID:amagdenko,项目名称:oiosaml.java,代码行数:17,代码来源:IdpMetadata.java

示例8: populateRequiredData

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    IDPSSODescriptor idpssoDescriptor = (IDPSSODescriptor) target;
    SingleSignOnService singleSignOnService = (SingleSignOnService) buildXMLObject(new QName(
            SAMLConstants.SAML20MD_NS, SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
    idpssoDescriptor.getSingleSignOnServices().add(singleSignOnService);
    NameIDMappingService nameIDMappingService = (NameIDMappingService) buildXMLObject(new QName(
            SAMLConstants.SAML20MD_NS, NameIDMappingService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
    idpssoDescriptor.getNameIDMappingServices().add(nameIDMappingService);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:IDPSSODescriptorSpecTest.java

示例9: populateRequiredData

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
protected void populateRequiredData() {
    super.populateRequiredData();
    IDPSSODescriptor idpssoDescriptor = (IDPSSODescriptor) target;
    SingleSignOnService singleSignOnService = (SingleSignOnService) buildXMLObject(new QName(SAMLConstants.SAML20MD_NS,
            SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MD_PREFIX));
    idpssoDescriptor.getSingleSignOnServices().add(singleSignOnService);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:IDPSSODescriptorSchemaTest.java

示例10: testSingleElementUnmarshall

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementUnmarshall() {
    SingleSignOnService service = ( SingleSignOnService) unmarshallElement(singleElementFile);
    
    assertEquals("Binding URI was not expected value", expectedBinding, service.getBinding());
    assertEquals("Location was not expected value", expectedLocation, service.getLocation());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:8,代码来源:SingleSignOnServiceTest.java

示例11: testSingleElementOptionalAttributesUnmarshall

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesUnmarshall() {
    SingleSignOnService service = ( SingleSignOnService) unmarshallElement(singleElementOptionalAttributesFile);
    
    assertEquals("Binding URI was not expected value", expectedBinding, service.getBinding());
    assertEquals("Location was not expected value", expectedLocation, service.getLocation());
    assertEquals("ResponseLocation was not expected value", expectedResponseLocation, service.getResponseLocation());;
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:9,代码来源:SingleSignOnServiceTest.java

示例12: testSingleElementMarshall

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS,  SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME);
    SingleSignOnService service = ( SingleSignOnService) buildXMLObject(qname);
    
    service.setBinding(expectedBinding);
    service.setLocation(expectedLocation);

    assertEquals(expectedDOM, service);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:11,代码来源:SingleSignOnServiceTest.java

示例13: testSingleElementOptionalAttributesMarshall

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
/** {@inheritDoc} */
public void testSingleElementOptionalAttributesMarshall() {
    QName qname = new QName(SAMLConstants.SAML20MD_NS,  SingleSignOnService.DEFAULT_ELEMENT_LOCAL_NAME);
    SingleSignOnService service = ( SingleSignOnService) buildXMLObject(qname);
    
    service.setBinding(expectedBinding);
    service.setLocation(expectedLocation);
    service.setResponseLocation(expectedResponseLocation);

    assertEquals(expectedOptionalAttributesDOM, service);
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:12,代码来源:SingleSignOnServiceTest.java

示例14: webSSOprofile

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
@Bean
public WebSSOProfile webSSOprofile() {
    return new WebSSOProfileImpl() {

        @Override
        protected AuthnRequest getAuthnRequest(SAMLMessageContext context, WebSSOProfileOptions options, AssertionConsumerService assertionConsumer, SingleSignOnService bindingService) throws SAMLException, MetadataProviderException {
            AuthnRequest authnRequest = super.getAuthnRequest(context, options, assertionConsumer, bindingService);
            authnRequest.setExtensions(buildExtensions());
            return authnRequest;
        }

        /**
         * Language extension to AuthnRequest:
         *
         *  <samlp:Extensions>
                <vetuma xmlns="urn:vetuma:SAML:2.0:extensions">
                    <LG>[fi|sv]</LG>
                </vetuma>
            </samlp:Extensions>
         */
        private Extensions buildExtensions() {
            Extensions extensions = new ExtensionsBuilder()
                    .buildObject("urn:oasis:names:tc:SAML:2.0:protocol", "Extensions", "saml2p");
            XSAny vetuma = new XSAnyBuilder().buildObject(new QName("urn:vetuma:SAML:2.0:extensions", "vetuma"));
            XSAny language = new XSAnyBuilder().buildObject(new QName("urn:vetuma:SAML:2.0:extensions", "LG"));

            String idpLanguageFromTarget = TargetStoringFilter.getRequestParamTarget(((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest())
                    .map(t -> t.startsWith(Urls.FRONT_SV) ? "sv" : "fi")
                    .orElse("fi");

            language.setTextContent(idpLanguageFromTarget);
            extensions.getUnknownXMLObjects().add(vetuma);
            vetuma.getUnknownXMLObjects().add(language);
            return extensions;
        }
    };
}
 
开发者ID:solita,项目名称:kansalaisaloite,代码行数:38,代码来源:WebSecurityConfig.java

示例15: getIPDEndpoint

import org.opensaml.saml2.metadata.SingleSignOnService; //导入依赖的package包/类
private Endpoint getIPDEndpoint() {
    SingleSignOnService endpoint = OpenSAMLUtils.buildSAMLObject(SingleSignOnService.class);
    endpoint.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI);
    endpoint.setLocation(getIPDSSODestination());

    return endpoint;
}
 
开发者ID:rasmusson,项目名称:webprofile-ref-project,代码行数:8,代码来源:AccessFilter.java


注:本文中的org.opensaml.saml2.metadata.SingleSignOnService类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。