@boxyhq/saml-jackson 0.1.5-beta.93 → 0.1.5-beta.94
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 +3 -3
- package/package.json +1 -1
- package/src/saml/saml.js +3 -15
package/README.md
CHANGED
@@ -105,7 +105,7 @@ docker run -p 5000:5000 -p 6000:6000 boxyhq/jackson:78e9099d
|
|
105
105
|
```
|
106
106
|
|
107
107
|
# Database Support
|
108
|
-
Jackson currently supports SQL databases (Postgres, CockroachDB, MySQL and MariaDB), MongoDB and Redis.
|
108
|
+
Jackson currently supports SQL databases (Postgres, CockroachDB, MySQL, and MariaDB), MongoDB, and Redis.
|
109
109
|
|
110
110
|
# Configuration
|
111
111
|
Configuration is done via env vars (and in the case of the npm library via an options object). The following options are supported and will have to be configured during deployment:
|
@@ -114,7 +114,7 @@ Configuration is done via env vars (and in the case of the npm library via an op
|
|
114
114
|
- EXTERNAL_URL (npm: externalUrl): The public URL to reach this service, used internally for documenting the SAML configuration instructions. Defaults to `http://{HOST_URL}:{HOST_PORT}` for Jackson service, required for npm library
|
115
115
|
- INTERNAL_HOST_URL: The URL to bind to expose the internal APIs, defaults to `localhost`. Do not configure this to a public network
|
116
116
|
- INTERNAL_HOST_PORT: The port to bind to for the internal APIs, defaults to `6000`
|
117
|
-
- SAML_AUDIENCE (npm: samlAudience): This is just an
|
117
|
+
- 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. Defaults to `https://saml.boxyhq.com` and is case sensitive. This does not have to be a real URL
|
118
118
|
- 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. Defaults to `false`
|
119
119
|
- DB_ENGINE (npm: db.engine): Supported values are `redis`, `sql`, `mongo`, `mem`. Defaults to `sql`
|
120
120
|
- DB_URL (npm: db.url): The database URL to connect to, for example `postgres://postgres:postgres@localhost:5450/jackson`
|
@@ -167,7 +167,7 @@ curl --location --request POST 'http://localhost:6000/api/v1/saml/config' \
|
|
167
167
|
- rawMetadata: The XML metadata file your customer gets from their Identity Provider
|
168
168
|
- defaultRedirectUrl: The redirect URL to use in the IdP login flow. Jackson will call this URL after completing an IdP login flow
|
169
169
|
- redirectUrl: JSON encoded array containing a list of allowed redirect URLs. Jackson will disallow any redirects not on this list (or not the default URL above)
|
170
|
-
- tenant: Jackson supports a multi-tenant architecture, this is a unique identifier you set from your side that relates back to your customer's tenant. This is normally an email, domain, an account id, or user
|
170
|
+
- tenant: Jackson supports a multi-tenant architecture, this is a unique identifier you set from your side that relates back to your customer's tenant. This is normally an email, domain, an account id, or user-id
|
171
171
|
- product: Jackson support multiple products, this is a unique identifier you set from your side that relates back to the product your customer is using
|
172
172
|
|
173
173
|
The response returns a JSON with `client_id` and `client_secret` that can be stored against your tenant and product for a more secure OAuth 2.0 flow. If you do not want to store the `client_id` and `client_secret` you can alternatively use `client_id=tentant=<tenantID>&product=<productID>` and any arbitrary value for `client_secret` when setting up the OAuth 2.0 flow.
|
package/package.json
CHANGED
package/src/saml/saml.js
CHANGED
@@ -141,20 +141,12 @@ module.exports = {
|
|
141
141
|
let X509Certificate = null;
|
142
142
|
let ssoPostUrl = null;
|
143
143
|
let ssoRedirectUrl = null;
|
144
|
-
let loginType = 'idp';
|
145
144
|
|
146
|
-
|
147
|
-
|
145
|
+
const ssoDes = rambda.pathOr(
|
146
|
+
[],
|
148
147
|
'EntityDescriptor.IDPSSODescriptor',
|
149
148
|
res
|
150
149
|
);
|
151
|
-
if (!ssoDes) {
|
152
|
-
ssoDes = rambda.pathOr([], 'EntityDescriptor.SPSSODescriptor', res);
|
153
|
-
if (!ssoDes) {
|
154
|
-
loginType = 'sp';
|
155
|
-
}
|
156
|
-
}
|
157
|
-
|
158
150
|
for (const ssoDesRec of ssoDes) {
|
159
151
|
const keyDes = ssoDesRec['KeyDescriptor'];
|
160
152
|
for (const keyDesRec of keyDes) {
|
@@ -165,10 +157,7 @@ module.exports = {
|
|
165
157
|
}
|
166
158
|
}
|
167
159
|
|
168
|
-
const ssoSvc =
|
169
|
-
ssoDesRec['SingleSignOnService'] ||
|
170
|
-
ssoDesRec['AssertionConsumerService'] ||
|
171
|
-
[];
|
160
|
+
const ssoSvc = ssoDesRec['SingleSignOnService'] || [];
|
172
161
|
for (const ssoSvcRec of ssoSvc) {
|
173
162
|
if (
|
174
163
|
rambda.pathOr('', '$.Binding', ssoSvcRec).endsWith('HTTP-POST')
|
@@ -199,7 +188,6 @@ module.exports = {
|
|
199
188
|
if (ssoRedirectUrl) {
|
200
189
|
ret.sso.redirectUrl = ssoRedirectUrl;
|
201
190
|
}
|
202
|
-
ret.loginType = loginType;
|
203
191
|
|
204
192
|
resolve(ret);
|
205
193
|
}
|