forked from alexeski/tableau_embed_okta_eas
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
51 lines (48 loc) · 1.41 KB
/
config.js
File metadata and controls
51 lines (48 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
const path = require("path");
const dotenv = require("dotenv");
const fs = require("fs");
// Read environment variables from "testenv". Override environment vars if they are already set. https://www.npmjs.com/package/dotenv
const TESTENV = path.resolve(__dirname, ".env");
if (fs.existsSync(TESTENV)) {
const envConfig = dotenv.parse(fs.readFileSync(TESTENV));
Object.keys(envConfig).forEach((k) => {
process.env[k] = envConfig[k];
});
}
var ISSUER =
process.env.ISSUER || "https://{yourOktaDomain}.com/oauth2/default";
var CLIENT_ID = process.env.CLIENT_ID || "{clientId}";
var CLIENT_SECRET = process.env.CLIENT_SECRET || "{clientSecret}";
var SPA_CLIENT_ID = process.env.SPA_CLIENT_ID || "{spaClientId}";
var OKTA_TESTING_DISABLEHTTPSCHECK = process.env.OKTA_TESTING_DISABLEHTTPSCHECK
? true
: false;
module.exports = {
webServer: {
port: 8080,
oidc: {
clientId: CLIENT_ID,
clientSecret: CLIENT_SECRET,
issuer: ISSUER,
appBaseUrl: "http://localhost:8080",
scope: "openid profile email tableau:views:embed",
testing: {
disableHttpsCheck: OKTA_TESTING_DISABLEHTTPSCHECK,
},
},
},
resourceServer: {
port: 8000,
oidc: {
clientId: SPA_CLIENT_ID,
issuer: ISSUER,
testing: {
disableHttpsCheck: OKTA_TESTING_DISABLEHTTPSCHECK,
},
},
assertClaims: {
aud: "api://default",
cid: SPA_CLIENT_ID,
},
},
};