1 | import AmpState from 'ampersand-state';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | const CredentialsConfig = AmpState.extend({
|
7 |
|
8 |
|
9 | extraProperties: 'allow',
|
10 |
|
11 | props: {
|
12 | |
13 |
|
14 |
|
15 |
|
16 | idbroker: ['object', false, (() => ({
|
17 | url: process.env.IDBROKER_BASE_URL || 'https://idbroker.webex.com'
|
18 | }))],
|
19 |
|
20 | |
21 |
|
22 |
|
23 |
|
24 | identity: ['object', false, (() => ({
|
25 | url: process.env.IDENTITY_BASE_URL || 'https://identity.webex.com'
|
26 | }))],
|
27 |
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 | authorizationString: ['string', false, process.env.WEBEX_AUTHORIZATION_STRING || process.env.AUTHORIZATION_STRING],
|
34 |
|
35 | |
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 | authorizeUrl: [
|
43 | 'string',
|
44 | false,
|
45 | process.env.WEBEX_AUTHORIZE_URL ||
|
46 | `${process.env.IDBROKER_BASE_URL || 'https://idbroker.webex.com'}/idb/oauth2/v1/authorize`
|
47 | ],
|
48 |
|
49 | |
50 |
|
51 |
|
52 |
|
53 | client_id: ['string', false, process.env.WEBEX_CLIENT_ID || process.env.COMMON_IDENTITY_CLIENT_ID || process.env.CLIENT_ID],
|
54 |
|
55 | |
56 |
|
57 |
|
58 |
|
59 | client_secret: ['string', false, process.env.WEBEX_CLIENT_SECRET || process.env.COMMON_IDENTITY_CLIENT_SECRET || process.env.CLIENT_SECRET],
|
60 |
|
61 | |
62 |
|
63 |
|
64 |
|
65 | redirect_uri: ['string', false, process.env.WEBEX_REDIRECT_URI || process.env.COMMON_IDENTITY_REDIRECT_URI || process.env.REDIRECT_URI],
|
66 |
|
67 | |
68 |
|
69 |
|
70 |
|
71 | scope: ['string', false, process.env.WEBEX_SCOPE || process.env.WEBEX_SCOPES || process.env.COMMON_IDENTITY_SCOPE || process.env.SCOPE],
|
72 |
|
73 | |
74 |
|
75 |
|
76 |
|
77 |
|
78 | cisService: ['string', false, 'webex']
|
79 | },
|
80 |
|
81 | derived: {
|
82 | |
83 |
|
84 |
|
85 |
|
86 |
|
87 | activationUrl: {
|
88 | deps: ['idbroker.url'],
|
89 | fn() {
|
90 | return `${this.idbroker.url || 'https://idbroker.webex.com'}/idb/token/v1/actions/UserActivation/invoke`;
|
91 | },
|
92 | cache: false
|
93 | },
|
94 |
|
95 |
|
96 | |
97 |
|
98 |
|
99 |
|
100 | tokenUrl: {
|
101 | deps: ['idbroker.url'],
|
102 | fn() {
|
103 | return process.env.TOKEN_URL || `${this.idbroker.url}/idb/oauth2/v1/access_token`;
|
104 | },
|
105 | cache: false
|
106 | },
|
107 |
|
108 | |
109 |
|
110 |
|
111 |
|
112 | revokeUrl: {
|
113 | deps: ['idbroker.url'],
|
114 | fn() {
|
115 | return process.env.REVOKE_URL || `${this.idbroker.url}/idb/oauth2/v1/revoke`;
|
116 | },
|
117 | cache: false
|
118 | },
|
119 |
|
120 | |
121 |
|
122 |
|
123 |
|
124 | logoutUrl: {
|
125 | deps: ['idbroker.url'],
|
126 | fn() {
|
127 | return `${this.idbroker.url}/idb/oauth2/v1/logout`;
|
128 | },
|
129 | cache: false
|
130 | },
|
131 |
|
132 | |
133 |
|
134 |
|
135 |
|
136 | setPasswordUrl: {
|
137 | deps: ['identity.url'],
|
138 | fn() {
|
139 | return `${this.identity.url || 'https://identity.webex.com'}/identity/scim/v1/Users`;
|
140 | },
|
141 | cache: false
|
142 | }
|
143 |
|
144 | }
|
145 |
|
146 | });
|
147 |
|
148 | export default CredentialsConfig;
|