@boxyhq/saml-jackson 0.1.5-beta.121 → 0.1.5-beta.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -6
- package/package.json +1 -1
package/README.md
CHANGED
@@ -128,6 +128,17 @@ Kubernetes and docker-compose deployment files will be coming soon.
|
|
128
128
|
|
129
129
|
Please follow the instructions [here](https://docs.google.com/document/d/1fk---Z9Ln59u-2toGKUkyO3BF6Dh3dscT2u4J2xHANE) to guide your customers in setting up SAML correctly for your product(s). You should create a copy of the doc and modify it with your custom settings, we have used the values that work for our demo apps.
|
130
130
|
|
131
|
+
### 1.1 SAML profile/claims/attributes mapping
|
132
|
+
|
133
|
+
As outlined in the guide above we try and support 4 attributes in the SAML claims - `id`, `email`, `firstName`, `lastName`. This is how the common SAML aattributes map over for most providers, but some providers have custom mappings. Please refer to the documentation on Identity Provider to understand the exact mapping.
|
134
|
+
|
135
|
+
| SAML Attribute | Jackson mapping |
|
136
|
+
| -------------------------------------------------------------------- | --------------- |
|
137
|
+
| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier | id |
|
138
|
+
| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress | email |
|
139
|
+
| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname | firstName |
|
140
|
+
| http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname | lastName |
|
141
|
+
|
131
142
|
### 2. SAML config API
|
132
143
|
|
133
144
|
Once your customer has set up the SAML app on their Identity Provider, the Identity Provider will generate an IdP or SP metadata file. Some Identity Providers only generate an IdP metadata file but it usually works for the SP login flow as well. It is an XML file that contains various attributes Jackson needs to validate incoming SAML login requests. This step is the equivalent of setting an OAuth 2.0 app and generating a client ID and client secret that will be used in the login flow.
|
@@ -138,6 +149,7 @@ The following API call sets up the configuration in Jackson:
|
|
138
149
|
|
139
150
|
```
|
140
151
|
curl --location --request POST 'http://localhost:6000/api/v1/saml/config' \
|
152
|
+
--header 'Authorization: Api-Key <Jackson API Key>' \
|
141
153
|
--header 'Content-Type: application/x-www-form-urlencoded' \
|
142
154
|
--data-urlencode 'rawMetadata=<IdP/SP metadata XML>' \
|
143
155
|
--data-urlencode 'defaultRedirectUrl=http://localhost:3000/login/saml' \
|
@@ -189,11 +201,11 @@ The code can then be exchanged for a token by making the following request:
|
|
189
201
|
curl --request POST \
|
190
202
|
--url 'http://localhost:5000/oauth/token' \
|
191
203
|
--header 'content-type: application/x-www-form-urlencoded' \
|
192
|
-
--data grant_type=authorization_code \
|
204
|
+
--data 'grant_type=authorization_code' \
|
193
205
|
--data 'client_id=<clientID or tenant and product query params as described in the SAML config API section above>' \
|
194
|
-
--data client_secret=<clientSecret or any arbitrary value if using the tenant and product in the clientID> \
|
206
|
+
--data 'client_secret=<clientSecret or any arbitrary value if using the tenant and product in the clientID>' \
|
195
207
|
--data 'redirect_uri=<redirect URL>' \
|
196
|
-
--data code=<code from the query parameter above>
|
208
|
+
--data 'code=<code from the query parameter above>'
|
197
209
|
```
|
198
210
|
|
199
211
|
- grant_type=authorization_code: This is the only supported flow, for now. We might extend this in the future
|
@@ -226,15 +238,15 @@ If everything goes well you should receive a JSON response with the user's profi
|
|
226
238
|
|
227
239
|
```
|
228
240
|
{
|
241
|
+
"id": <id from the Identity Provider>,
|
229
242
|
"email": "sjackson@coolstartup.com",
|
230
243
|
"firstName": "SAML"
|
231
|
-
"
|
232
|
-
"lastName": "Jackson",
|
244
|
+
"lastName": "Jackson"
|
233
245
|
}
|
234
246
|
```
|
235
247
|
|
236
|
-
- email: The email address of the user as provided by the Identity Provider
|
237
248
|
- id: The id of the user as provided by the Identity Provider
|
249
|
+
- email: The email address of the user as provided by the Identity Provider
|
238
250
|
- firstName: The first name of the user as provided by the Identity Provider
|
239
251
|
- lastName: The last name of the user as provided by the Identity Provider
|
240
252
|
|
@@ -266,6 +278,7 @@ The following options are supported and will have to be configured during deploy
|
|
266
278
|
| EXTERNAL_URL (npm: externalUrl) | The public URL to reach this service, used internally for documenting the SAML configuration instructions. | `http://{HOST_URL}:{HOST_PORT}` |
|
267
279
|
| INTERNAL_HOST_URL | The URL to bind to expose the internal APIs. Do not configure this to a public network. | `localhost` |
|
268
280
|
| INTERNAL_HOST_PORT | The port to bind to for the internal APIs. | `6000` |
|
281
|
+
| JACKSON_API_KEYS | A comma separated list of API keys that will be validated when serving the Config API requests | |
|
269
282
|
| SAML_AUDIENCE (npm: samlAudience) | This is just an identifier to validate the SAML audience, this value will also get configured in the SAML apps created by your customers. Once set do not change this value unless you get your customers to reconfigure their SAML again. It is case-sensitive. This does not have to be a real URL. | `https://saml.boxyhq.com` |
|
270
283
|
| IDP_ENABLED (npm: idpEnabled) | Set to `true` to enable IdP initiated login for SAML. SP initiated login is the only recommended flow but you might have to support IdP login at times. | `false` |
|
271
284
|
| DB_ENGINE (npm: db.engine) | Supported values are `redis`, `sql`, `mongo`, `mem`. | `sql` |
|