Skip to content

Commit 1661960

Browse files
Merge branch 'master' into exclude-joda-time
2 parents 9531b5d + 10002ab commit 1661960

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+472
-470
lines changed

README.md

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
# OneLogin's SAML Java Toolkit <!-- omit in toc -->
1+
# SAML Java Toolkit <!-- omit in toc -->
22

33
[![Build Status](https://travis-ci.org/onelogin/java-saml.svg?branch=master)](https://travis-ci.org/onelogin/java-saml) [![Coverage Status](https://coveralls.io/repos/github/onelogin/java-saml/badge.svg?branch=master)](https://coveralls.io/github/onelogin/java-saml?branch=master)
44

5-
## **Notice:** This project is currently not under active development, please see [#388](https://github.com/onelogin/java-saml/issues/388) for more information.
6-
75
Add SAML support to your Java applications using this library.
8-
Forget those complicated libraries and use that open source library provided and supported by OneLogin Inc.
96

107
2.8.0 uses xmlsec 2.2.3 which fixes [CVE-2021-40690](https://snyk.io/vuln/SNYK-JAVA-ORGAPACHESANTUARIO-1655558)
118

@@ -87,7 +84,7 @@ since 2002, but lately it has become popular due to its advantages as follows:
8784

8885
## General description
8986

90-
OneLogin's SAML Java toolkit lets you turn a Java application into a SP
87+
SAML Java toolkit lets you turn a Java application into a SP
9188
(Service Provider) that can be connected to an IdP (Identity Provider).
9289

9390
Supports:
@@ -108,7 +105,6 @@ Key features:
108105
* **Easy to use** - Programmer will be allowed to code high-level and
109106
low-level programming; 2 easy-to-use APIs are available.
110107
* **Tested** - Thoroughly tested.
111-
* **Popular** - OneLogin's customers use it. Add easy support to your java web projects.
112108

113109
## Security warning
114110

@@ -198,7 +194,7 @@ Select a [Tomcat Server](http://crunchify.com/step-by-step-guide-to-setup-and-in
198194
## Getting started
199195
### Learning the toolkit
200196

201-
OneLogin's new SAML Java SAML Toolkit contains different folders (core, toolkit, samples) and some files.
197+
Java SAML Toolkit contains different folders (core, toolkit, samples) and some files.
202198

203199
Let's start describing them:
204200

@@ -261,7 +257,7 @@ onelogin.saml2.sp.entityid = http://localhost:8080/java-saml-tookit-jspsample/me
261257
onelogin.saml2.sp.assertion_consumer_service.url = http://localhost:8080/java-saml-tookit-jspsample/acs.jsp
262258

263259
# SAML protocol binding to be used when returning the <Response>
264-
# message. Onelogin Toolkit supports for this endpoint the
260+
# message. SAMLToolkit supports for this endpoint the
265261
# HTTP-POST binding only
266262
onelogin.saml2.sp.assertion_consumer_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST
267263

@@ -270,7 +266,7 @@ onelogin.saml2.sp.assertion_consumer_service.binding = urn:oasis:names:tc:SAML:2
270266
onelogin.saml2.sp.single_logout_service.url = http://localhost:8080/java-saml-tookit-jspsample/sls.jsp
271267

272268
# SAML protocol binding to be used when returning the <LogoutResponse> or sending the <LogoutRequest>
273-
# message. Onelogin Toolkit supports for this endpoint the
269+
# message. SAMLToolkit supports for this endpoint the
274270
# HTTP-Redirect binding only
275271
onelogin.saml2.sp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
276272

@@ -326,7 +322,7 @@ onelogin.saml2.idp.entityid =
326322
onelogin.saml2.idp.single_sign_on_service.url =
327323

328324
# SAML protocol binding to be used to deliver the <AuthnRequest> message
329-
# to the IdP. Onelogin Toolkit supports for this endpoint the
325+
# to the IdP. SAMLToolkit supports for this endpoint the
330326
# HTTP-Redirect binding only
331327
onelogin.saml2.idp.single_sign_on_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
332328

@@ -340,7 +336,7 @@ onelogin.saml2.idp.single_logout_service.url =
340336
onelogin.saml2.idp.single_logout_service.response.url =
341337

342338
# SAML protocol binding to be used when returning the <Response>
343-
# message. Onelogin Toolkit supports for this endpoint the
339+
# message. SAMLToolkit supports for this endpoint the
344340
# HTTP-Redirect binding only
345341
onelogin.saml2.idp.single_logout_service.binding = urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect
346342

@@ -755,7 +751,7 @@ In order to avoid replay attacks, you can store the ID of the SAML messages alre
755751
Get the ID of the last processed message with the getLastMessageId method of the Auth object.
756752

757753
## Demo included in the toolkit
758-
The Onelogin's Java Toolkit allows you to provide the settings in a unique file as described at the [Settings section](https://github.com/onelogin/java-saml/#Settings).
754+
The Java Toolkit allows you to provide the settings in a unique file as described at the [Settings section](https://github.com/onelogin/java-saml/#Settings).
759755

760756
#### SP setup
761757
Configure the SP part and review the metadata of the IdP and complete the IdP info. Later configure how the toolkit will work enabling/disabling the security settings.

core/pom.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
</parent>
88

99
<packaging>jar</packaging>
10-
<name>OneLogin java-saml Toolkit Core</name>
10+
<name>java-saml Toolkit Core</name>
1111
<artifactId>java-saml-core</artifactId>
1212

1313
<dependencies>
@@ -68,6 +68,12 @@
6868
<version>4.3.4</version>
6969
<optional>true</optional>
7070
</dependency>
71+
<dependency>
72+
<groupId>com.fasterxml.jackson.core</groupId>
73+
<artifactId>jackson-databind</artifactId>
74+
<version>2.13.4.2</version>
75+
<optional>true</optional>
76+
</dependency>
7177
<dependency>
7278
<groupId>com.azure</groupId>
7379
<artifactId>azure-identity</artifactId>

core/src/main/java/com/onelogin/saml2/authn/AuthnRequest.java

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import com.onelogin.saml2.util.Util;
1818

1919
/**
20-
* AuthNRequest class of OneLogin's Java Toolkit.
20+
* AuthNRequest class of Java Toolkit.
2121
*
2222
* A class that implements SAML 2 Authentication Request
2323
*/
@@ -79,7 +79,7 @@ public AuthnRequest(Saml2Settings settings) {
7979
public AuthnRequest(Saml2Settings settings, boolean forceAuthn, boolean isPassive, boolean setNameIdPolicy, String nameIdValueReq) {
8080
this(settings, new AuthnRequestParams(forceAuthn, isPassive, setNameIdPolicy, nameIdValueReq));
8181
}
82-
82+
8383
/**
8484
* Constructs the AuthnRequest object.
8585
*
@@ -126,7 +126,7 @@ public AuthnRequest(Saml2Settings settings, AuthnRequestParams params) {
126126
* This method is invoked at construction time, after all the other fields of
127127
* this class have already been initialised. Its default implementation simply
128128
* returns the input XML as-is, with no change.
129-
*
129+
*
130130
* @param authnRequestXml
131131
* the XML produced for this AuthnRequest by the standard
132132
* implementation provided by {@link AuthnRequest}
@@ -144,10 +144,10 @@ protected String postProcessXml(final String authnRequestXml, final AuthnRequest
144144
/**
145145
* @return the base64 encoded unsigned AuthnRequest (deflated or not)
146146
*
147-
* @param deflated
147+
* @param deflated
148148
* If deflated or not the encoded AuthnRequest
149149
*
150-
* @throws IOException
150+
* @throws IOException
151151
*/
152152
public String getEncodedAuthnRequest(Boolean deflated) throws IOException {
153153
String encodedAuthnRequest;
@@ -161,18 +161,18 @@ public String getEncodedAuthnRequest(Boolean deflated) throws IOException {
161161
}
162162
return encodedAuthnRequest;
163163
}
164-
164+
165165
/**
166166
* @return base64 encoded, unsigned AuthnRequest (deflated or not)
167-
*
168-
* @throws IOException
167+
*
168+
* @throws IOException
169169
*/
170170
public String getEncodedAuthnRequest() throws IOException {
171171
return getEncodedAuthnRequest(null);
172172
}
173173

174174
/**
175-
* @return unsigned plain-text AuthnRequest.
175+
* @return unsigned plain-text AuthnRequest.
176176
*/
177177
public String getAuthnRequestXml() {
178178
return authnRequestString;
@@ -185,9 +185,9 @@ public String getAuthnRequestXml() {
185185
* the authentication request input parameters
186186
* @param settings
187187
* Saml2Settings object. Setting data
188-
*
189-
* @return the StrSubstitutor object of the AuthnRequest
190-
*/
188+
*
189+
* @return the StrSubstitutor object of the AuthnRequest
190+
*/
191191
private StrSubstitutor generateSubstitutor(AuthnRequestParams params, Saml2Settings settings) {
192192

193193
Map<String, String> valueMap = new HashMap<String, String>();
@@ -242,7 +242,7 @@ private StrSubstitutor generateSubstitutor(AuthnRequestParams params, Saml2Setti
242242
if (organization != null) {
243243
String displayName = organization.getOrgDisplayName();
244244
if (!displayName.isEmpty()) {
245-
providerStr = " ProviderName=\""+ Util.toXml(displayName) + "\"";
245+
providerStr = " ProviderName=\""+ Util.toXml(displayName) + "\"";
246246
}
247247
}
248248
valueMap.put("providerStr", providerStr);
@@ -288,10 +288,10 @@ public String getId()
288288
{
289289
return id;
290290
}
291-
291+
292292
/**
293293
* Returns the issue instant of this message.
294-
*
294+
*
295295
* @return a new {@link Calendar} instance carrying the issue instant of this message
296296
*/
297297
public Calendar getIssueInstant() {

core/src/main/java/com/onelogin/saml2/authn/SamlResponse.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import com.onelogin.saml2.util.Util;
3838

3939
/**
40-
* SamlResponse class of OneLogin's Java Toolkit.
40+
* SamlResponse class of Java Toolkit.
4141
*
4242
* A class that implements SAML 2 Authentication Response parser/validator
4343
*/
@@ -752,7 +752,7 @@ public String getResponseIssuer() throws XPathExpressionException, ValidationErr
752752
}
753753
return null;
754754
}
755-
755+
756756
/**
757757
* Gets the Assertion Issuer.
758758
*
@@ -777,7 +777,7 @@ public String getAssertionIssuer() throws XPathExpressionException, ValidationEr
777777
throw new ValidationError("Issuer of the Assertion not found or multiple.", ValidationError.ISSUER_NOT_FOUND_IN_ASSERTION);
778778
}
779779
}
780-
780+
781781
/**
782782
* Gets the Issuers (from Response and Assertion). If the same issuer appears
783783
* both in the Response and in the Assertion (as it should), the returned list
@@ -1102,11 +1102,11 @@ public String getError() {
11021102
public Exception getValidationException() {
11031103
return validationException;
11041104
}
1105-
1105+
11061106
/**
11071107
* Sets the validation exception that this {@link SamlResponse} should return
11081108
* when a validation error occurs.
1109-
*
1109+
*
11101110
* @param validationException
11111111
* the validation exception to set
11121112
*/

core/src/main/java/com/onelogin/saml2/exception/SAMLException.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.onelogin.saml2.exception;
22

33
/**
4-
* Top-level exception class for the OneLogin SAML client.
4+
* Top-level exception class for the SAML client.
55
*/
66
public class SAMLException extends Exception {
77

@@ -10,7 +10,7 @@ public class SAMLException extends Exception {
1010
/**
1111
* Construct a SAMLException with the provided error message.
1212
*
13-
* @param message
13+
* @param message
1414
* The human-readable error message associated with this exception.
1515
*/
1616
public SAMLException(String message) {
@@ -33,12 +33,12 @@ public SAMLException(Throwable cause) {
3333
*
3434
* @param message
3535
* The human-readable error message associated with this exception.
36-
*
37-
* @param cause
36+
*
37+
* @param cause
3838
* The upstream cause associated with this exception.
3939
*/
4040
public SAMLException(String message, Throwable cause) {
4141
super(message, cause);
4242
}
4343

44-
}
44+
}

0 commit comments

Comments
 (0)