1
1
2
- export interface AuthConfig {
3
-
2
+ export class AuthConfig {
4
3
/**
5
4
* The client's id as registered with the auth server
5
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
6
6
*/
7
- clientId ?: string ;
7
+ public clientId ? = '' ;
8
8
9
9
/**
10
10
* The client's redirectUri as registered with the auth server
11
+ *
12
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
11
13
*/
12
- redirectUri ?: string ;
14
+ public redirectUri ? = '' ;
13
15
14
16
/**
15
17
* An optional second redirectUri where the auth server
16
18
* redirects the user to after logging out.
19
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
17
20
*/
18
- postLogoutRedirectUri ?: string ;
21
+ public postLogoutRedirectUri ? = '' ;
19
22
20
23
/**
21
24
* The auth server's endpoint that allows to log
22
25
* the user in when using implicit flow.
26
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
27
+ *
23
28
*/
24
- loginUrl ?: string ;
29
+ public loginUrl ? = '' ;
25
30
26
31
/**
27
32
* The requested scopes
33
+ *
34
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
35
+ *
28
36
*/
29
- scope ?: string ;
37
+ public scope ? = 'openid profile' ;
38
+
39
+ /**
40
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
41
+ */
42
+ public resource ? = '' ;
43
+
44
+ /**
45
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
46
+ */
47
+ public rngUrl ? = '' ;
30
48
31
49
/**
32
50
* Defines whether to use OpenId Connect during
33
- * implicit flow. Defaults to true.
51
+ * implicit flow.
52
+ *
53
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
34
54
*/
35
- oidc ?: boolean ;
55
+ public oidc ? = true ;
36
56
37
57
/**
38
58
* Defines whether to request a access token during
39
- * implicit flow. Defaults to true;
59
+ * implicit flow.
60
+ *
61
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
62
+ */
63
+ public requestAccessToken ? = true ;
64
+
65
+ /**
66
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
40
67
*/
41
- requestAccessToken ?: boolean ;
68
+ public options ?: any ;
42
69
43
70
/**
44
71
* The issuer's uri.
72
+ *
73
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
45
74
*/
46
- issuer ?: string ;
75
+ public issuer ? = '' ;
47
76
48
77
/**
49
78
* The logout url.
79
+ *
80
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
50
81
*/
51
- logoutUrl ?: string ;
82
+ public logoutUrl ? = '' ;
52
83
53
84
/**
54
85
* Defines whether to clear the hash fragment after logging in.
86
+ *
87
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
55
88
*/
56
- clearHashAfterLogin ?: boolean ;
89
+ public clearHashAfterLogin ? = true ;
57
90
58
91
/**
59
92
* Url of the token endpoint as defined by OpenId Connect and OAuth 2.
93
+ *
94
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
60
95
*/
61
- tokenEndpoint ?: string ;
96
+ public tokenEndpoint ?: string ;
62
97
63
98
/**
64
99
* Url of the userinfo endpoint as defined by OpenId Connect.
100
+ *
101
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
102
+ *
65
103
*/
66
- userinfoEndpoint ?: string ;
104
+ public userinfoEndpoint ?: string ;
105
+
106
+ /**
107
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
108
+ */
109
+ public responseType ? = 'token' ;
67
110
68
111
/**
69
112
* Defines whether additional debug information should
70
113
* be shown at the console.
114
+ *
115
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
71
116
*/
72
- showDebugInformation ?: boolean ;
117
+ public showDebugInformation ? = false ;
73
118
74
119
/**
75
120
* The redirect uri used when doing silent refresh.
121
+ *
122
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
76
123
*/
77
- silentRefreshRedirectUri ?: string ;
124
+ public silentRefreshRedirectUri ? = '' ;
78
125
79
- silentRefreshMessagePrefix ?: string ;
126
+ /**
127
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
128
+ */
129
+ public silentRefreshMessagePrefix ? = '' ;
80
130
81
131
/**
82
132
* Set this to true to display the iframe used for
83
133
* silent refresh for debugging.
134
+ *
135
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
84
136
*/
85
- silentRefreshShowIFrame ?: boolean ;
137
+ public silentRefreshShowIFrame ? = false ;
86
138
87
139
/**
88
140
* Timeout for silent refresh.
141
+ *
142
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
89
143
*/
90
- siletRefreshTimeout ?: number ;
144
+ public siletRefreshTimeout ?: number = 1000 * 20 ;
91
145
92
146
/**
93
147
* Some auth servers don't allow using password flow
@@ -96,71 +150,100 @@ export interface AuthConfig {
96
150
* here. As this passwort is exposed to the public
97
151
* it does not bring additional security and is therefore
98
152
* as good as using no password.
153
+ *
154
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
99
155
*/
100
- dummyClientSecret ?: string ;
156
+ public dummyClientSecret ?: string ;
157
+
101
158
102
159
/**
103
160
* Defines whether https is required.
104
161
* The default value is remoteOnly which only allows
105
162
* http for location, while every other domains need
106
163
* to be used with https.
164
+ *
165
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
107
166
*/
108
- requireHttps ?: boolean | 'remoteOnly' ;
167
+ public requireHttps ?: boolean | 'remoteOnly' = 'remoteOnly' ;
109
168
110
169
/**
111
170
* Defines whether every url provided by the discovery
112
171
* document has to start with the issuer's url.
172
+ *
173
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
113
174
*/
114
- strictDiscoveryDocumentValidation ?: boolean ;
175
+ public strictDiscoveryDocumentValidation ? = true ;
115
176
116
177
/**
117
178
* JSON Web Key Set (https://tools.ietf.org/html/rfc7517)
118
179
* with keys used to validate received id_tokens.
119
180
* This is taken out of the disovery document. Can be set manually too.
181
+ *
182
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
120
183
*/
121
- jwks ?: object ;
184
+ public jwks ?: object ;
122
185
123
186
/**
124
187
* Map with additional query parameter that are appended to
125
188
* the request when initializing implicit flow.
189
+ *
190
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
126
191
*/
127
- customQueryParams ?: object ;
192
+ public customQueryParams ?: object ;
128
193
129
- silentRefreshIFrameName ?: string ;
194
+ /**
195
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
196
+ */
197
+ public silentRefreshIFrameName ? = 'angular-oauth-oidc-silent-refresh-iframe' ;
130
198
131
199
/**
132
200
* Defines when the token_timeout event should be raised.
133
201
* If you set this to the default value 0.75, the event
134
202
* is triggered after 75% of the token's life time.
203
+ *
204
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
135
205
*/
136
- timeoutFactor ?: number ;
206
+ public timeoutFactor ? = 0.75 ;
137
207
138
208
/**
139
209
* If true, the lib will try to check whether the user
140
210
* is still logged in on a regular basis as described
141
211
* in http://openid.net/specs/openid-connect-session-1_0.html#ChangeNotification
142
212
* @type {boolean }
213
+ *
214
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
143
215
*/
144
- checkSessionPeriodic ?: boolean ;
216
+ public sessionChecksEnabled ? = false ;
145
217
146
218
/**
147
219
* Intervall in msec for checking the session
148
220
* according to http://openid.net/specs/openid-connect-session-1_0.html#ChangeNotification
149
221
* @type {number }
222
+ *
223
+ * @internal DEPREACTED/ LEGACY. Use method configure instead.
150
224
*/
151
- checkSessionIntervall ?: number ;
225
+ public sessionCheckIntervall ? = 3 * 1000 ;
152
226
153
227
/**
154
228
* Url for the iframe used for session checks
155
229
* @internal DEPREACTED/ LEGACY. Use method configure instead.
156
230
*/
157
- checkSessionIFrameUrl ?: string ;
231
+ public sessionCheckIFrameUrl ?: string ;
158
232
159
233
/**
160
234
* Name of the iframe to use for session checks
161
235
* @type {number }
162
236
*
163
237
* @internal DEPREACTED/ LEGACY. Use method configure instead.
164
238
*/
165
- checkSessionIFrameName ?: string ;
239
+ public sessionCheckIFrameName ? = 'angular-oauth-oidc-check-session-iframe' ;
240
+
241
+ /**
242
+ * This property has been introduced to disable at_hash checks
243
+ * and is indented for Identity Provider that does not deliver
244
+ * an at_hash EVEN THOUGH its recommended by the OIDC specs.
245
+ * Of course, when disabling these checks the we are bypassing
246
+ * a security check which means we are more vulnerable.
247
+ */
248
+ public disableAtHashCheck ? = false ;
166
249
}
0 commit comments