You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-24Lines changed: 23 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,17 +5,17 @@
5
5
Add SAML support to your Java applications using this library.
6
6
Forget those complicated libraries and use that open source library provided and supported by OneLogin Inc.
7
7
8
-
This is the Version 2.0.0, compatible with java6 / java7 / java8.
8
+
This is version 2.0.0, compatible with java6 / java7 / java8.
9
9
10
-
The 1.1.2 is consider deprecated. If you used it, we strongly recommend to migrate to that new version.
11
-
We rebuilt the toolkit on 2.0.0 so code/settings that you had will not be compatible.
10
+
Version 1.1.2 is considered to be deprecated. If you have used it, we strongly recommend that you migrate to the new version.
11
+
We rebuilt the toolkit on 2.0.0, so code/settings that you had been using in the previous version will no longer be compatible.
12
12
13
13
14
14
## Why add SAML support to my software?
15
15
16
16
SAML is an XML-based standard for web browser single sign-on and is defined by
17
17
the OASIS Security Services Technical Committee. The standard has been around
18
-
since 2002, but lately it is becoming popular due its advantages:
18
+
since 2002, but lately it has become popular due to its advantages as follows:
19
19
20
20
***Usability** - One-click access from portals or intranets, deep linking,
21
21
password elimination and automatically renewing sessions make life
@@ -53,9 +53,9 @@ Key features:
53
53
54
54
***saml2int** - Implements the SAML 2.0 Web Browser SSO Profile.
55
55
***Session-less** - Forget those common conflicts between the SP and
56
-
the final app, the toolkit delegate session in the final app.
56
+
the final app; the toolkit delegates session in the final app.
57
57
***Easy to use** - Programmer will be allowed to code high-level and
58
-
low-level programming, 2 easy to use APIs are available.
58
+
low-level programming; 2 easy-to-use APIs are available.
59
59
***Tested** - Thoroughly tested.
60
60
***Popular** - OneLogin's customers use it. Add easy support to your java web projects.
61
61
@@ -136,16 +136,16 @@ At the Package Explorer, select the jsp-sample project, 2nd bottom of the mouse
136
136
Select a [Tomcat Server](http://crunchify.com/step-by-step-guide-to-setup-and-install-apache-tomcat-server-in-eclipse-development-environment-ide/) in order to deploy the server.
137
137
138
138
## Getting started
139
-
### Knowing the toolkit
139
+
### Learning the toolkit
140
140
141
-
The new OneLogin's SAML Java SAML Toolkit contains different folders (core, toolkit, samples) and some files.
141
+
OneLogin's new SAML Java SAML Toolkit contains different folders (core, toolkit, samples) and some files.
142
142
143
143
Let's start describing them:
144
144
145
145
#### core (com.onelogin:java-saml-core) ####
146
-
This folder contains a maven project with the heart of java-saml, classes and methods to handle AuthNRequest, SAMLResponse, LogoutRequest, LogoutResponse and Metadata (low level API). In addition contains classes to load the settings of the toolkit and the HttpRequest class, a framework-agnostic representation of an HTTP request.
146
+
This folder contains a maven project with the heart of java-saml, classes and methods to handle AuthNRequest, SAMLResponse, LogoutRequest, LogoutResponse and Metadata (low level API). In addition, it contains classes to load the settings of the toolkit and the HttpRequest class, a framework-agnostic representation of an HTTP request.
147
147
148
-
In the repo, at *src/main/java* you will find the source, at *src/main/resources/schemas* there are xsd schemas used to validate the SAML messages, at *src/test/java* are the tests for its classes and at *src/test/resources* different settings, SAML messages and certificates used on the junit tests.
148
+
In the repo, at *src/main/java* you will find the source; at *src/main/resources/schemas*, there are xsd schemas used to validate the SAML messages; at *src/test/java* are the tests for its classes; and at *src/test/resources*can be found different settings, SAML messages and certificates used by the junit tests.
149
149
150
150
151
151
#### toolkit (com.onelogin:java-saml) ####
@@ -155,7 +155,7 @@ In the repo, at *src/main/java* you will find the source and at *src/test/java*
First of all we need to configure the toolkit. The SP's info, the IdP's info, and in some cases, configure advanced security issues like signatures and encryption.
177
+
First of all we need to configure the toolkit. The SP's info, the IdP's info, and in some cases, configuration for advanced security issues, such as signatures and encryption.
178
178
179
-
All the settings are defined in one unique file, by default the Auth class loads a *onelogin.saml.properties* file with the Auth() method, but if we named it in a differnt way we can use Auth(filename);
179
+
All the settings are defined in one unique file; by default, the Auth class loads a *onelogin.saml.properties* file with the Auth() method, but if we named it in a different way, we can use Auth(filename);
180
180
181
181
Here are the list of properties to be defined on the settings file:
182
182
```properties
@@ -359,18 +359,17 @@ We can set a 'returnTo' url parameter to the login function and that will be con
359
359
String targetUrl = 'https://example.com';
360
360
auth.login(returnTo=targetUrl)
361
361
```
362
-
The login method can recieve 4 more optional parameters:
363
-
- forceAuthn When true the AuthNReuqest will set the ForceAuthn='true'
364
-
- isPassive When true the AuthNReuqest will set the Ispassive='true'
365
-
- setNameIdPolicy When true the AuthNReuqest will set a nameIdPolicy element.
366
-
- stay True if we want to stay (returns the url string) False to execute a redirection to that url (IdP SSO URL)
367
-
368
-
By default the login method initiates a redirect to the SAML Identity Provider. You can use the stay parameter, to prevent that, and execute the redirection manually. We need to use that
369
-
if a match on the future SAMLResponse ID and the AuthNRequest ID to be sent is required, that AuthNRequest ID must be extracted and stored for future validation so we can't execute the redirection on the login, instead set stay to true, then get that ID by
362
+
The login method can receive 4 more optional parameters:
363
+
-*forceAuthn* When true the AuthNRequest will have the 'ForceAuthn' attribute set to 'true'
364
+
-*isPassive* When true the AuthNRequest will have the 'Ispassive' attribute set to 'true'
365
+
-*setNameIdPolicy* When true the AuthNRequest will set a nameIdPolicy element.
366
+
-*stay* Set to true to stay (returns the url string), otherwise set to false to execute a redirection to that url (IdP SSO URL)
367
+
368
+
By default, the login method initiates a redirect to the SAML Identity Provider. You can use the *stay* parameter, to prevent that, and execute the redirection manually. We need to use that if a match on the future SAMLResponse ID and the AuthNRequest ID to be sent is required. That AuthNRequest ID must be extracted and stored for future validation, so we can't execute the redirection on the login. Instead, set *stay* to true, then get that ID by
370
369
```
371
370
auth.getLastRequestId()
372
371
```
373
-
and later excuting the redirection manually.
372
+
and later executing the redirection manually.
374
373
375
374
376
375
#### The SP Endpoints
@@ -441,7 +440,7 @@ if (!errors.isEmpty()) {
441
440
}
442
441
}
443
442
```
444
-
The SAML response is processed and then checked that there are no errors. It also verifies that the user is authenticated and stored the userdata in session.
443
+
The SAML response is processed and then checked to ensure that there are no errors. It also verifies that the user is authenticated, and then the userdata is stored in the session.
445
444
At that point there are 2 possible alternatives:
446
445
- If no RelayState is provided, we could show the user data in this view or however we wanted.
447
446
- If RelayState is provided, a redirection take place.
0 commit comments