Skip to content

Commit adc67d9

Browse files
committed
Property name alignment, added template properties
1 parent 3856625 commit adc67d9

File tree

4 files changed

+133
-7
lines changed

4 files changed

+133
-7
lines changed

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/identicum/alpine-jdk17-maven:latest as builder
1+
FROM ghcr.io/identicum/alpine-jdk17-maven:latest AS builder
22
WORKDIR /app
33
COPY . .
44
RUN mvn install -DskipTests
@@ -10,7 +10,7 @@ COPY --from=builder /app/target/saml-demoapp-java.war /tmp/
1010

1111
ENV ONELOGIN_SAML2_DEBUG=true
1212
ENV ONELOGIN_SAML2_STRICT=true
13-
ENV IDP_ENTITY_DESCRIPTOR=""
13+
ENV ONELOGIN_SAML2_IDP_ENTITYID = ""
1414
ENV ONELOGIN_SAML2_SP_ENTITYID=""
1515
ENV ONELOGIN_SAML2_SP_ASSERTION_CONSUMER_SERVICE_URL=""
1616
ENV ONELOGIN_SAML2_SP_SINGLE_LOGOUT_SERVICE_URL=""

compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
- ONELOGIN_SAML2_SP_ENTITYID=http://demoapp1:8081/
2424
- ONELOGIN_SAML2_SP_ASSERTION_CONSUMER_SERVICE_URL=http://demoapp1:8081/acs.jsp
2525
- ONELOGIN_SAML2_SP_SINGLE_LOGOUT_SERVICE_URL=http://demoapp1:8081/sls.jsp
26-
- IDP_ENTITY_DESCRIPTOR=http://idp:8080/realms/demorealm/protocol/saml/descriptor
26+
- ONELOGIN_SAML2_IDP_ENTITYID=http://idp:8080/realms/demorealm/protocol/saml/descriptor
2727
depends_on:
2828
idp:
2929
condition: service_healthy

src/main/resources/onelogin.saml.template

Lines changed: 128 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,39 @@ onelogin.saml2.debug =
55
onelogin.saml2.strict =
66

77
# IDP metadata URI (e.g. http://idp:8080/auth/realms/demorealm/protocol/saml/descriptor)
8-
idp.entity.descriptor =
8+
onelogin.saml2.idp.entityid =
9+
10+
# SSO endpoint info of the IdP. (Authentication Request protocol)
11+
# URL Target of the IdP where the SP will send the Authentication Request Message
12+
onelogin.saml2.idp.single_sign_on_service.url =
13+
14+
# SAML protocol binding to be used to deliver the <AuthnRequest> message to the IdP. SAMLToolkit supports for this endpoint the HTTP-Redirect binding only
15+
onelogin.saml2.idp.single_sign_on_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
16+
17+
# SLO endpoint info of the IdP.
18+
# URL Location of the IdP where the SP will send the SLO Request
19+
onelogin.saml2.idp.single_logout_service.url =
20+
21+
# Optional SLO Response endpoint info of the IdP.
22+
# URL Location of the IdP where the SP will send the SLO Response. If left blank, same URL as onelogin.saml2.idp.single_logout_service.url will be used.
23+
# Some IdPs use a separate URL for sending a logout request and response, use this property to set the separate response url
24+
onelogin.saml2.idp.single_logout_service.response.url =
25+
26+
# SAML protocol binding to be used when returning the <Response> message. SAMLToolkit supports for this endpoint the HTTP-Redirect binding only
27+
onelogin.saml2.idp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
28+
29+
# Public x509 certificate of the IdP
30+
onelogin.saml2.idp.x509cert =
31+
32+
# Instead of use the whole x509cert you can use a fingerprint
33+
# (openssl x509 -noout -fingerprint -in "idp.crt" to generate it,
34+
# or add for example the -sha256 , -sha384 or -sha512 parameter)
35+
#
36+
# If a fingerprint is provided, then the certFingerprintAlgorithm is required in order to
37+
# let the toolkit know which Algorithm was used. Possible values: sha1, sha256, sha384 or sha512
38+
# 'sha1' is the default value.
39+
# onelogin.saml2.idp.certfingerprint =
40+
# onelogin.saml2.idp.certfingerprint_algorithm = sha256
941

1042
# SP
1143
# When configuring the SP in your IDP, the URL for the SP metadata is http://app_hostname/metadata.jsp
@@ -16,10 +48,104 @@ onelogin.saml2.sp.entityid =
1648
# URL Location where the <Response> from the IdP will be returned (e.g.: http://demoapp1:8081/acs.jsp)
1749
onelogin.saml2.sp.assertion_consumer_service.url =
1850

51+
# SAML protocol binding to be used when returning the <Response> message. SAMLToolkit supports for this endpoint the HTTP-POST binding only
52+
onelogin.saml2.sp.assertion_consumer_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
53+
1954
# URL for LogoutResponse
2055
onelogin.saml2.sp.single_logout_service.url =
2156

57+
# SAML protocol binding to be used when returning the <LogoutResponse> or sending the <LogoutRequest> message. SAMLToolkit supports for this endpoint the HTTP-Redirect binding only
58+
onelogin.saml2.sp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
59+
2260
# NameID format, e.g.:
2361
# urn:oasis:names:tc:SAML:2.0:nameid-format:persistent
2462
# urn:oasis:names:tc:SAML:2.0:nameid-format:emailAddress
25-
onelogin.saml2.sp.nameidformat =
63+
onelogin.saml2.sp.nameidformat =
64+
65+
# Indicates that the nameID of the <samlp:logoutRequest> sent by this SP will be encrypted.
66+
onelogin.saml2.security.nameid_encrypted = false
67+
68+
# Usually x509cert and privateKey of the SP are provided by files placed at the certs folder. But we can also provide them with the following parameters
69+
onelogin.saml2.sp.x509cert =
70+
71+
# Requires Format PKCS#8 BEGIN PRIVATE KEY
72+
# If you have PKCS#1 BEGIN RSA PRIVATE KEY convert it by openssl pkcs8 -topk8 -inform pem -nocrypt -in sp.rsa_key -outform pem -out sp.pem
73+
onelogin.saml2.sp.privatekey =
74+
75+
76+
# Security settings
77+
#
78+
79+
# Indicates whether the <samlp:AuthnRequest> messages sent by this SP
80+
# will be signed. [The Metadata of the SP will offer this info]
81+
onelogin.saml2.security.authnrequest_signed = false
82+
83+
# Indicates whether the <samlp:logoutRequest> messages sent by this SP
84+
# will be signed.
85+
onelogin.saml2.security.logoutrequest_signed = false
86+
87+
# Indicates whether the <samlp:logoutResponse> messages sent by this SP
88+
# will be signed.
89+
onelogin.saml2.security.logoutresponse_signed = false
90+
91+
# Indicates a requirement for the <samlp:Response>, <samlp:LogoutRequest> and
92+
# <samlp:LogoutResponse> elements received by this SP to be signed.
93+
onelogin.saml2.security.want_messages_signed = false
94+
95+
# Indicates a requirement for the <saml:Assertion> elements received by this SP to be signed.
96+
onelogin.saml2.security.want_assertions_signed = false
97+
98+
# Indicates a requirement for the Metadata of this SP to be signed.
99+
# Right now supported null (in order to not sign) or true (sign using SP private key)
100+
onelogin.saml2.security.sign_metadata =
101+
102+
# Indicates a requirement for the Assertions received by this SP to be encrypted
103+
onelogin.saml2.security.want_assertions_encrypted = false
104+
105+
# Indicates a requirement for the NameID received by this SP to be encrypted
106+
onelogin.saml2.security.want_nameid_encrypted = false
107+
108+
# Authentication context.
109+
# Set Empty and no AuthContext will be sent in the AuthNRequest
110+
# You can set multiple values (comma separated them)
111+
onelogin.saml2.security.requested_authncontext = urn:oasis:names:tc:SAML:2.0:ac:classes:Password
112+
113+
# Allows the authn comparison parameter to be set, defaults to 'exact'
114+
onelogin.saml2.security.onelogin.saml2.security.requested_authncontextcomparison = exact
115+
116+
# Allows duplicated names in the attribute statement
117+
onelogin.saml2.security.allow_duplicated_attribute_name = false
118+
119+
# Indicates if the SP will validate all received xmls.
120+
# (In order to validate the xml, 'strict' and 'wantXMLValidation' must be true).
121+
onelogin.saml2.security.want_xml_validation = true
122+
123+
# Algorithm that the toolkit will use on signing process. Options:
124+
# 'http://www.w3.org/2000/09/xmldsig#rsa-sha1'
125+
# 'http://www.w3.org/2000/09/xmldsig#dsa-sha1'
126+
# 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256'
127+
# 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha384'
128+
# 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha512'
129+
onelogin.saml2.security.signature_algorithm = http://www.w3.org/2001/04/xmldsig-more#rsa-sha256
130+
131+
# Algorithm that the toolkit will use on digest process. Options:
132+
# 'http://www.w3.org/2000/09/xmldsig#sha1'
133+
# 'http://www.w3.org/2001/04/xmlenc#sha256'
134+
# 'http://www.w3.org/2001/04/xmldsig-more#sha384'
135+
# 'http://www.w3.org/2001/04/xmlenc#sha512'
136+
onelogin.saml2.security.digest_algorithm = http://www.w3.org/2001/04/xmlenc#sha256
137+
138+
# Reject Signatures with deprecated algorithms (sha1)
139+
onelogin.saml2.security.reject_deprecated_alg = true
140+
141+
# Organization
142+
onelogin.saml2.organization.name = Identicum
143+
onelogin.saml2.organization.displayname = Identicum SA
144+
onelogin.saml2.organization.url = https://identicum.com
145+
onelogin.saml2.organization.lang =
146+
147+
# Contacts
148+
onelogin.saml2.contacts.technical.given_name = Technical Guy
149+
onelogin.saml2.contacts.technical.email_address = technical@example.com
150+
onelogin.saml2.contacts.support.given_name = Support Guy
151+
onelogin.saml2.contacts.support.email_address = support@@example.com

src/main/webapp/samlsettings.jsp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public Properties getSamlSettings() throws Exception {
3636
}
3737
});
3838
39-
String idpEntityDescriptor = properties.getProperty("idp.entity.descriptor");
39+
String idpEntityDescriptor = properties.getProperty("onelogin.saml2.idp.entityid");
4040
if(StringUtils.isNotBlank(idpEntityDescriptor)){
4141
List<String> idpProperties = Arrays.asList("onelogin.saml2.idp.entityid", "onelogin.saml2.idp.x509cert", "onelogin.saml2.idp.single_sign_on_service.url", "onelogin.saml2.idp.single_logout_service.url");
42-
URL url = new URL(properties.getProperty("idp.entity.descriptor"));
42+
URL url = new URL(properties.getProperty("onelogin.saml2.idp.entityid"));
4343
4444
Map<String, Object> idpMetadata = IdPMetadataParser.parseRemoteXML(url);
4545
idpMetadata = idpMetadata

0 commit comments

Comments
 (0)