This repository has been archived by the owner on Nov 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 481
/
SAMLProcessorImplTest.xml
95 lines (84 loc) · 4.87 KB
/
SAMLProcessorImplTest.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/util https://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="org.springframework.security.saml"/>
<!-- Initialization of OpenSAML library-->
<bean class="org.springframework.security.saml.SAMLBootstrap"/>
<!-- Central storage of cryptographic keys -->
<bean id="keyManager" class="org.springframework.security.saml.key.JKSKeyManager">
<constructor-arg value="classpath:org/springframework/security/saml/key/keystore.jks"/>
<constructor-arg type="java.lang.String" value="nalle123"/>
<constructor-arg>
<map>
<entry key="apollo" value="nalle123"/>
</map>
</constructor-arg>
<constructor-arg type="java.lang.String" value="apollo"/>
</bean>
<!-- Class loading incoming SAML messages from httpRequest stream -->
<bean id="processor" class="org.springframework.security.saml.processor.SAMLProcessorImpl">
<constructor-arg ref="bindings"/>
</bean>
<!-- Bindigs, encoders and decoders used for creating and parsing messages -->
<util:list id="bindings">
<bean class="org.springframework.security.saml.processor.HTTPPostBinding">
<constructor-arg ref="parserPool"/>
<constructor-arg>
<bean class="org.opensaml.saml2.binding.decoding.HTTPPostDecoder">
<constructor-arg ref="parserPool"/>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="org.opensaml.saml2.binding.encoding.HTTPPostEncoder">
<constructor-arg ref="velocityEngine"/>
<constructor-arg value="/templates/saml2-post-binding.vm"/>
</bean>
</constructor-arg>
</bean>
<bean class="org.springframework.security.saml.processor.HTTPRedirectDeflateBinding">
<constructor-arg>
<bean class="org.opensaml.saml2.binding.decoding.HTTPRedirectDeflateDecoder">
<constructor-arg ref="parserPool"/>
</bean>
</constructor-arg>
<constructor-arg>
<bean class="org.opensaml.saml2.binding.encoding.HTTPRedirectDeflateEncoder"/>
</constructor-arg>
</bean>
</util:list>
<!-- IDP Metadata configuration - paths to metadata of IDPs in circle of trust is here -->
<!-- Do no forget to call iniitalize method on providers -->
<bean id="metadata" class="org.springframework.security.saml.metadata.MetadataManager">
<constructor-arg index="0">
<list>
<bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
<constructor-arg index="0">
<value type="java.io.File">classpath:testIDP.xml</value>
</constructor-arg>
<property name="parserPool" ref="parserPool"/>
</bean>
<bean class="org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider">
<constructor-arg index="0">
<value type="java.io.File">classpath:testSP.xml</value>
</constructor-arg>
<property name="parserPool" ref="parserPool"/>
</bean>
</list>
</constructor-arg>
<property name="hostedSPName" value="http://localhost:8081/spring-security-saml2-webapp"/>
<!-- OPTIONAL property: can tell the system which IDP should be used for authenticating user by default. -->
<property name="defaultIDP" value="http://localhost:8080/opensso"/>
</bean>
<!-- Provider of default SAML Context -->
<bean id="contextProvider" class="org.springframework.security.saml.context.SAMLContextProviderImpl" />
<!-- Factory which disables message storage capabilities -->
<bean class="org.springframework.security.saml.storage.EmptyStorageFactory"/>
<!-- XML parser pool needed for OpenSAML parsing -->
<bean id="parserPool" class="org.opensaml.xml.parse.BasicParserPool" scope="singleton"/>
<!-- Instantiator of the velocity engine -->
<bean id="velocityEngine" class="org.springframework.security.saml.util.VelocityFactory"
factory-method="getEngine"/>
</beans>