@backstage/plugin-auth-backend 0.20.0-next.2 → 0.20.1-next.0
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/CHANGELOG.md +52 -0
- package/config.d.ts +0 -14
- package/dist/index.cjs.js +179 -510
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/package.json +16 -15
package/dist/index.cjs.js
CHANGED
|
@@ -8,12 +8,12 @@ var alpha = require('@backstage/plugin-catalog-node/alpha');
|
|
|
8
8
|
var express = require('express');
|
|
9
9
|
var Router = require('express-promise-router');
|
|
10
10
|
var cookieParser = require('cookie-parser');
|
|
11
|
-
var
|
|
11
|
+
var pluginAuthBackendModuleAtlassianProvider = require('@backstage/plugin-auth-backend-module-atlassian-provider');
|
|
12
|
+
var Auth0InternalStrategy = require('passport-auth0');
|
|
12
13
|
var crypto = require('crypto');
|
|
13
14
|
var url = require('url');
|
|
14
15
|
var errors = require('@backstage/errors');
|
|
15
16
|
var jwtDecoder = require('jwt-decode');
|
|
16
|
-
var Auth0InternalStrategy = require('passport-auth0');
|
|
17
17
|
var fetch = require('node-fetch');
|
|
18
18
|
var NodeCache = require('node-cache');
|
|
19
19
|
var jose = require('jose');
|
|
@@ -25,9 +25,10 @@ var pluginAuthBackendModuleGoogleProvider = require('@backstage/plugin-auth-back
|
|
|
25
25
|
var passportMicrosoft = require('passport-microsoft');
|
|
26
26
|
var pluginAuthBackendModuleOauth2Provider = require('@backstage/plugin-auth-backend-module-oauth2-provider');
|
|
27
27
|
var openidClient = require('openid-client');
|
|
28
|
-
var
|
|
28
|
+
var pluginAuthBackendModuleOktaProvider = require('@backstage/plugin-auth-backend-module-okta-provider');
|
|
29
29
|
var passportOneloginOauth = require('passport-onelogin-oauth');
|
|
30
30
|
var passportSaml = require('passport-saml');
|
|
31
|
+
var passportOauth2 = require('passport-oauth2');
|
|
31
32
|
var catalogClient = require('@backstage/catalog-client');
|
|
32
33
|
var catalogModel = require('@backstage/catalog-model');
|
|
33
34
|
var luxon = require('luxon');
|
|
@@ -65,82 +66,109 @@ function _interopNamespace(e) {
|
|
|
65
66
|
var express__default = /*#__PURE__*/_interopDefaultLegacy(express);
|
|
66
67
|
var Router__default = /*#__PURE__*/_interopDefaultLegacy(Router);
|
|
67
68
|
var cookieParser__default = /*#__PURE__*/_interopDefaultLegacy(cookieParser);
|
|
68
|
-
var
|
|
69
|
+
var Auth0InternalStrategy__default = /*#__PURE__*/_interopDefaultLegacy(Auth0InternalStrategy);
|
|
69
70
|
var crypto__default = /*#__PURE__*/_interopDefaultLegacy(crypto);
|
|
70
71
|
var crypto__namespace = /*#__PURE__*/_interopNamespace(crypto);
|
|
71
72
|
var jwtDecoder__default = /*#__PURE__*/_interopDefaultLegacy(jwtDecoder);
|
|
72
|
-
var Auth0InternalStrategy__default = /*#__PURE__*/_interopDefaultLegacy(Auth0InternalStrategy);
|
|
73
73
|
var fetch__default = /*#__PURE__*/_interopDefaultLegacy(fetch);
|
|
74
74
|
var NodeCache__default = /*#__PURE__*/_interopDefaultLegacy(NodeCache);
|
|
75
75
|
var session__default = /*#__PURE__*/_interopDefaultLegacy(session);
|
|
76
76
|
var connectSessionKnex__default = /*#__PURE__*/_interopDefaultLegacy(connectSessionKnex);
|
|
77
77
|
var passport__default = /*#__PURE__*/_interopDefaultLegacy(passport);
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
};
|
|
98
|
-
super(optionsWithURLs, verify);
|
|
99
|
-
__publicField$j(this, "profileURL");
|
|
100
|
-
this.profileURL = "https://api.atlassian.com/me";
|
|
101
|
-
this.name = "atlassian";
|
|
102
|
-
this._oauth2.useAuthorizationHeaderforGET(true);
|
|
103
|
-
}
|
|
104
|
-
authorizationParams() {
|
|
105
|
-
return {
|
|
106
|
-
audience: "api.atlassian.com",
|
|
107
|
-
prompt: "consent"
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
userProfile(accessToken, done) {
|
|
111
|
-
this._oauth2.get(this.profileURL, accessToken, (err, body) => {
|
|
112
|
-
if (err) {
|
|
113
|
-
return done(
|
|
114
|
-
new OAuth2Strategy.InternalOAuthError(
|
|
115
|
-
"Failed to fetch user profile",
|
|
116
|
-
err.statusCode
|
|
117
|
-
)
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
if (!body) {
|
|
121
|
-
return done(
|
|
122
|
-
new Error("Failed to fetch user profile, body cannot be empty")
|
|
123
|
-
);
|
|
79
|
+
function createAuthProviderIntegration(config) {
|
|
80
|
+
var _a;
|
|
81
|
+
return Object.freeze({
|
|
82
|
+
...config,
|
|
83
|
+
resolvers: Object.freeze((_a = config.resolvers) != null ? _a : {})
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function adaptLegacyOAuthHandler(authHandler) {
|
|
88
|
+
return authHandler && (async (result, ctx) => authHandler(
|
|
89
|
+
{
|
|
90
|
+
fullProfile: result.fullProfile,
|
|
91
|
+
accessToken: result.session.accessToken,
|
|
92
|
+
params: {
|
|
93
|
+
scope: result.session.scope,
|
|
94
|
+
id_token: result.session.idToken,
|
|
95
|
+
token_type: result.session.tokenType,
|
|
96
|
+
expires_in: result.session.expiresInSeconds
|
|
124
97
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
98
|
+
},
|
|
99
|
+
ctx
|
|
100
|
+
));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function adaptLegacyOAuthSignInResolver(signInResolver) {
|
|
104
|
+
return signInResolver && (async (input, ctx) => signInResolver(
|
|
105
|
+
{
|
|
106
|
+
profile: input.profile,
|
|
107
|
+
result: {
|
|
108
|
+
fullProfile: input.result.fullProfile,
|
|
109
|
+
accessToken: input.result.session.accessToken,
|
|
110
|
+
refreshToken: input.result.session.refreshToken,
|
|
111
|
+
params: {
|
|
112
|
+
scope: input.result.session.scope,
|
|
113
|
+
id_token: input.result.session.idToken,
|
|
114
|
+
token_type: input.result.session.tokenType,
|
|
115
|
+
expires_in: input.result.session.expiresInSeconds
|
|
116
|
+
}
|
|
131
117
|
}
|
|
118
|
+
},
|
|
119
|
+
ctx
|
|
120
|
+
));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function adaptOAuthSignInResolverToLegacy(resolvers) {
|
|
124
|
+
const legacyResolvers = {};
|
|
125
|
+
for (const name of Object.keys(resolvers)) {
|
|
126
|
+
const resolver = resolvers[name];
|
|
127
|
+
legacyResolvers[name] = () => async (input, ctx) => {
|
|
128
|
+
var _a;
|
|
129
|
+
return resolver(
|
|
130
|
+
{
|
|
131
|
+
profile: input.profile,
|
|
132
|
+
result: {
|
|
133
|
+
fullProfile: input.result.fullProfile,
|
|
134
|
+
session: {
|
|
135
|
+
accessToken: input.result.accessToken,
|
|
136
|
+
expiresInSeconds: input.result.params.expires_in,
|
|
137
|
+
scope: input.result.params.scope,
|
|
138
|
+
idToken: input.result.params.id_token,
|
|
139
|
+
tokenType: (_a = input.result.params.token_type) != null ? _a : "bearer",
|
|
140
|
+
refreshToken: input.result.refreshToken
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
ctx
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return legacyResolvers;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const atlassian = createAuthProviderIntegration({
|
|
152
|
+
create(options) {
|
|
153
|
+
var _a;
|
|
154
|
+
return pluginAuthNode.createOAuthProviderFactory({
|
|
155
|
+
authenticator: pluginAuthBackendModuleAtlassianProvider.atlassianAuthenticator,
|
|
156
|
+
profileTransform: adaptLegacyOAuthHandler(options == null ? void 0 : options.authHandler),
|
|
157
|
+
signInResolver: adaptLegacyOAuthSignInResolver((_a = options == null ? void 0 : options.signIn) == null ? void 0 : _a.resolver)
|
|
132
158
|
});
|
|
133
159
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
class Auth0Strategy extends Auth0InternalStrategy__default["default"] {
|
|
163
|
+
constructor(options, verify) {
|
|
164
|
+
const optionsWithURLs = {
|
|
165
|
+
...options,
|
|
166
|
+
authorizationURL: `https://${options.domain}/authorize`,
|
|
167
|
+
tokenURL: `https://${options.domain}/oauth/token`,
|
|
168
|
+
userInfoURL: `https://${options.domain}/userinfo`,
|
|
169
|
+
apiUrl: `https://${options.domain}/api`
|
|
143
170
|
};
|
|
171
|
+
super(optionsWithURLs, verify);
|
|
144
172
|
}
|
|
145
173
|
}
|
|
146
174
|
|
|
@@ -211,10 +239,10 @@ const ensuresXRequestedWith = (req) => {
|
|
|
211
239
|
|
|
212
240
|
const prepareBackstageIdentityResponse = pluginAuthNode.prepareBackstageIdentityResponse;
|
|
213
241
|
|
|
214
|
-
var __defProp$
|
|
215
|
-
var __defNormalProp$
|
|
216
|
-
var __publicField$
|
|
217
|
-
__defNormalProp$
|
|
242
|
+
var __defProp$g = Object.defineProperty;
|
|
243
|
+
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
244
|
+
var __publicField$g = (obj, key, value) => {
|
|
245
|
+
__defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
218
246
|
return value;
|
|
219
247
|
};
|
|
220
248
|
const THOUSAND_DAYS_MS = 1e3 * 24 * 60 * 60 * 1e3;
|
|
@@ -223,8 +251,8 @@ class OAuthAdapter {
|
|
|
223
251
|
constructor(handlers, options) {
|
|
224
252
|
this.handlers = handlers;
|
|
225
253
|
this.options = options;
|
|
226
|
-
__publicField$
|
|
227
|
-
__publicField$
|
|
254
|
+
__publicField$g(this, "baseCookieOptions");
|
|
255
|
+
__publicField$g(this, "setNonceCookie", (res, nonce, cookieConfig) => {
|
|
228
256
|
res.cookie(`${this.options.providerId}-nonce`, nonce, {
|
|
229
257
|
maxAge: TEN_MINUTES_MS,
|
|
230
258
|
...this.baseCookieOptions,
|
|
@@ -232,34 +260,34 @@ class OAuthAdapter {
|
|
|
232
260
|
path: `${cookieConfig.path}/handler`
|
|
233
261
|
});
|
|
234
262
|
});
|
|
235
|
-
__publicField$
|
|
263
|
+
__publicField$g(this, "setGrantedScopeCookie", (res, scope, cookieConfig) => {
|
|
236
264
|
res.cookie(`${this.options.providerId}-granted-scope`, scope, {
|
|
237
265
|
maxAge: THOUSAND_DAYS_MS,
|
|
238
266
|
...this.baseCookieOptions,
|
|
239
267
|
...cookieConfig
|
|
240
268
|
});
|
|
241
269
|
});
|
|
242
|
-
__publicField$
|
|
270
|
+
__publicField$g(this, "getRefreshTokenFromCookie", (req) => {
|
|
243
271
|
return req.cookies[`${this.options.providerId}-refresh-token`];
|
|
244
272
|
});
|
|
245
|
-
__publicField$
|
|
273
|
+
__publicField$g(this, "getGrantedScopeFromCookie", (req) => {
|
|
246
274
|
return req.cookies[`${this.options.providerId}-granted-scope`];
|
|
247
275
|
});
|
|
248
|
-
__publicField$
|
|
276
|
+
__publicField$g(this, "setRefreshTokenCookie", (res, refreshToken, cookieConfig) => {
|
|
249
277
|
res.cookie(`${this.options.providerId}-refresh-token`, refreshToken, {
|
|
250
278
|
maxAge: THOUSAND_DAYS_MS,
|
|
251
279
|
...this.baseCookieOptions,
|
|
252
280
|
...cookieConfig
|
|
253
281
|
});
|
|
254
282
|
});
|
|
255
|
-
__publicField$
|
|
283
|
+
__publicField$g(this, "removeRefreshTokenCookie", (res, cookieConfig) => {
|
|
256
284
|
res.cookie(`${this.options.providerId}-refresh-token`, "", {
|
|
257
285
|
maxAge: 0,
|
|
258
286
|
...this.baseCookieOptions,
|
|
259
287
|
...cookieConfig
|
|
260
288
|
});
|
|
261
289
|
});
|
|
262
|
-
__publicField$
|
|
290
|
+
__publicField$g(this, "getCookieConfig", (origin) => {
|
|
263
291
|
return this.options.cookieConfigurer({
|
|
264
292
|
providerId: this.options.providerId,
|
|
265
293
|
baseUrl: this.options.baseUrl,
|
|
@@ -557,164 +585,21 @@ const executeFetchUserProfileStrategy = async (providerStrategy, accessToken) =>
|
|
|
557
585
|
});
|
|
558
586
|
};
|
|
559
587
|
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
resolvers: Object.freeze((_a = config.resolvers) != null ? _a : {})
|
|
565
|
-
});
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
var __defProp$h = Object.defineProperty;
|
|
569
|
-
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
570
|
-
var __publicField$h = (obj, key, value) => {
|
|
571
|
-
__defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
572
|
-
return value;
|
|
573
|
-
};
|
|
574
|
-
const atlassianDefaultAuthHandler = async ({
|
|
575
|
-
fullProfile,
|
|
576
|
-
params
|
|
577
|
-
}) => ({
|
|
578
|
-
profile: makeProfileInfo(fullProfile, params.id_token)
|
|
579
|
-
});
|
|
580
|
-
class AtlassianAuthProvider {
|
|
581
|
-
constructor(options) {
|
|
582
|
-
__publicField$h(this, "_strategy");
|
|
583
|
-
__publicField$h(this, "signInResolver");
|
|
584
|
-
__publicField$h(this, "authHandler");
|
|
585
|
-
__publicField$h(this, "resolverContext");
|
|
586
|
-
this.resolverContext = options.resolverContext;
|
|
587
|
-
this.authHandler = options.authHandler;
|
|
588
|
-
this.signInResolver = options.signInResolver;
|
|
589
|
-
this._strategy = new AtlassianStrategy(
|
|
590
|
-
{
|
|
591
|
-
clientID: options.clientId,
|
|
592
|
-
clientSecret: options.clientSecret,
|
|
593
|
-
callbackURL: options.callbackUrl,
|
|
594
|
-
scope: options.scopes
|
|
595
|
-
},
|
|
596
|
-
(accessToken, refreshToken, params, fullProfile, done) => {
|
|
597
|
-
done(void 0, {
|
|
598
|
-
fullProfile,
|
|
599
|
-
accessToken,
|
|
600
|
-
refreshToken,
|
|
601
|
-
params
|
|
602
|
-
});
|
|
603
|
-
}
|
|
604
|
-
);
|
|
605
|
-
}
|
|
606
|
-
async start(req) {
|
|
607
|
-
return await executeRedirectStrategy(req, this._strategy, {
|
|
608
|
-
state: encodeState(req.state)
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
async handler(req) {
|
|
612
|
-
const { result } = await executeFrameHandlerStrategy(
|
|
613
|
-
req,
|
|
614
|
-
this._strategy
|
|
615
|
-
);
|
|
616
|
-
return {
|
|
617
|
-
response: await this.handleResult(result),
|
|
618
|
-
refreshToken: result.refreshToken
|
|
619
|
-
};
|
|
620
|
-
}
|
|
621
|
-
async handleResult(result) {
|
|
622
|
-
const { profile } = await this.authHandler(result, this.resolverContext);
|
|
623
|
-
const response = {
|
|
624
|
-
providerInfo: {
|
|
625
|
-
idToken: result.params.id_token,
|
|
626
|
-
accessToken: result.accessToken,
|
|
627
|
-
scope: result.params.scope,
|
|
628
|
-
expiresInSeconds: result.params.expires_in
|
|
629
|
-
},
|
|
630
|
-
profile
|
|
631
|
-
};
|
|
632
|
-
if (this.signInResolver) {
|
|
633
|
-
response.backstageIdentity = await this.signInResolver(
|
|
634
|
-
{
|
|
635
|
-
result,
|
|
636
|
-
profile
|
|
637
|
-
},
|
|
638
|
-
this.resolverContext
|
|
639
|
-
);
|
|
640
|
-
}
|
|
641
|
-
return response;
|
|
642
|
-
}
|
|
643
|
-
async refresh(req) {
|
|
644
|
-
const { accessToken, params, refreshToken } = await executeRefreshTokenStrategy(
|
|
645
|
-
this._strategy,
|
|
646
|
-
req.refreshToken,
|
|
647
|
-
req.scope
|
|
648
|
-
);
|
|
649
|
-
const fullProfile = await executeFetchUserProfileStrategy(
|
|
650
|
-
this._strategy,
|
|
651
|
-
accessToken
|
|
652
|
-
);
|
|
653
|
-
return {
|
|
654
|
-
response: await this.handleResult({
|
|
655
|
-
fullProfile,
|
|
656
|
-
params,
|
|
657
|
-
accessToken
|
|
658
|
-
}),
|
|
659
|
-
refreshToken
|
|
660
|
-
};
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
const atlassian = createAuthProviderIntegration({
|
|
664
|
-
create(options) {
|
|
665
|
-
return ({ providerId, globalConfig, config, resolverContext }) => OAuthEnvironmentHandler.mapConfig(config, (envConfig) => {
|
|
666
|
-
var _a, _b;
|
|
667
|
-
const clientId = envConfig.getString("clientId");
|
|
668
|
-
const clientSecret = envConfig.getString("clientSecret");
|
|
669
|
-
const scopes = envConfig.getString("scopes");
|
|
670
|
-
const customCallbackUrl = envConfig.getOptionalString("callbackUrl");
|
|
671
|
-
const callbackUrl = customCallbackUrl || `${globalConfig.baseUrl}/${providerId}/handler/frame`;
|
|
672
|
-
const authHandler = (_a = options == null ? void 0 : options.authHandler) != null ? _a : atlassianDefaultAuthHandler;
|
|
673
|
-
const provider = new AtlassianAuthProvider({
|
|
674
|
-
clientId,
|
|
675
|
-
clientSecret,
|
|
676
|
-
scopes,
|
|
677
|
-
callbackUrl,
|
|
678
|
-
authHandler,
|
|
679
|
-
signInResolver: (_b = options == null ? void 0 : options.signIn) == null ? void 0 : _b.resolver,
|
|
680
|
-
resolverContext
|
|
681
|
-
});
|
|
682
|
-
return OAuthAdapter.fromConfig(globalConfig, provider, {
|
|
683
|
-
providerId,
|
|
684
|
-
callbackUrl
|
|
685
|
-
});
|
|
686
|
-
});
|
|
687
|
-
}
|
|
688
|
-
});
|
|
689
|
-
|
|
690
|
-
class Auth0Strategy extends Auth0InternalStrategy__default["default"] {
|
|
691
|
-
constructor(options, verify) {
|
|
692
|
-
const optionsWithURLs = {
|
|
693
|
-
...options,
|
|
694
|
-
authorizationURL: `https://${options.domain}/authorize`,
|
|
695
|
-
tokenURL: `https://${options.domain}/oauth/token`,
|
|
696
|
-
userInfoURL: `https://${options.domain}/userinfo`,
|
|
697
|
-
apiUrl: `https://${options.domain}/api`
|
|
698
|
-
};
|
|
699
|
-
super(optionsWithURLs, verify);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
var __defProp$g = Object.defineProperty;
|
|
704
|
-
var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
705
|
-
var __publicField$g = (obj, key, value) => {
|
|
706
|
-
__defNormalProp$g(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
588
|
+
var __defProp$f = Object.defineProperty;
|
|
589
|
+
var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
590
|
+
var __publicField$f = (obj, key, value) => {
|
|
591
|
+
__defNormalProp$f(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
707
592
|
return value;
|
|
708
593
|
};
|
|
709
594
|
class Auth0AuthProvider {
|
|
710
595
|
constructor(options) {
|
|
711
|
-
__publicField$
|
|
712
|
-
__publicField$
|
|
713
|
-
__publicField$
|
|
714
|
-
__publicField$
|
|
715
|
-
__publicField$
|
|
716
|
-
__publicField$
|
|
717
|
-
__publicField$
|
|
596
|
+
__publicField$f(this, "_strategy");
|
|
597
|
+
__publicField$f(this, "signInResolver");
|
|
598
|
+
__publicField$f(this, "authHandler");
|
|
599
|
+
__publicField$f(this, "resolverContext");
|
|
600
|
+
__publicField$f(this, "audience");
|
|
601
|
+
__publicField$f(this, "connection");
|
|
602
|
+
__publicField$f(this, "connectionScope");
|
|
718
603
|
/**
|
|
719
604
|
* Due to passport-auth0 forcing options.state = true,
|
|
720
605
|
* passport-oauth2 requires express-session to be installed
|
|
@@ -723,7 +608,7 @@ class Auth0AuthProvider {
|
|
|
723
608
|
* passport-oauth2, which is the StateStore implementation used when options.state = false,
|
|
724
609
|
* allowing us to avoid using express-session in order to integrate with auth0.
|
|
725
610
|
*/
|
|
726
|
-
__publicField$
|
|
611
|
+
__publicField$f(this, "store", {
|
|
727
612
|
store(_req, cb) {
|
|
728
613
|
cb(null, null);
|
|
729
614
|
},
|
|
@@ -864,23 +749,23 @@ const auth0 = createAuthProviderIntegration({
|
|
|
864
749
|
}
|
|
865
750
|
});
|
|
866
751
|
|
|
867
|
-
var __defProp$
|
|
868
|
-
var __defNormalProp$
|
|
869
|
-
var __publicField$
|
|
870
|
-
__defNormalProp$
|
|
752
|
+
var __defProp$e = Object.defineProperty;
|
|
753
|
+
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
754
|
+
var __publicField$e = (obj, key, value) => {
|
|
755
|
+
__defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
871
756
|
return value;
|
|
872
757
|
};
|
|
873
758
|
const ALB_JWT_HEADER = "x-amzn-oidc-data";
|
|
874
759
|
const ALB_ACCESS_TOKEN_HEADER = "x-amzn-oidc-accesstoken";
|
|
875
760
|
class AwsAlbAuthProvider {
|
|
876
761
|
constructor(options) {
|
|
877
|
-
__publicField$
|
|
878
|
-
__publicField$
|
|
879
|
-
__publicField$
|
|
880
|
-
__publicField$
|
|
881
|
-
__publicField$
|
|
882
|
-
__publicField$
|
|
883
|
-
__publicField$
|
|
762
|
+
__publicField$e(this, "region");
|
|
763
|
+
__publicField$e(this, "issuer");
|
|
764
|
+
__publicField$e(this, "resolverContext");
|
|
765
|
+
__publicField$e(this, "keyCache");
|
|
766
|
+
__publicField$e(this, "authHandler");
|
|
767
|
+
__publicField$e(this, "signInResolver");
|
|
768
|
+
__publicField$e(this, "getKey", async (header) => {
|
|
884
769
|
if (!header.kid) {
|
|
885
770
|
throw new errors.AuthenticationError("No key id was specified in header");
|
|
886
771
|
}
|
|
@@ -1008,18 +893,18 @@ const awsAlb = createAuthProviderIntegration({
|
|
|
1008
893
|
}
|
|
1009
894
|
});
|
|
1010
895
|
|
|
1011
|
-
var __defProp$
|
|
1012
|
-
var __defNormalProp$
|
|
1013
|
-
var __publicField$
|
|
1014
|
-
__defNormalProp$
|
|
896
|
+
var __defProp$d = Object.defineProperty;
|
|
897
|
+
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
898
|
+
var __publicField$d = (obj, key, value) => {
|
|
899
|
+
__defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1015
900
|
return value;
|
|
1016
901
|
};
|
|
1017
902
|
class BitbucketAuthProvider {
|
|
1018
903
|
constructor(options) {
|
|
1019
|
-
__publicField$
|
|
1020
|
-
__publicField$
|
|
1021
|
-
__publicField$
|
|
1022
|
-
__publicField$
|
|
904
|
+
__publicField$d(this, "_strategy");
|
|
905
|
+
__publicField$d(this, "signInResolver");
|
|
906
|
+
__publicField$d(this, "authHandler");
|
|
907
|
+
__publicField$d(this, "resolverContext");
|
|
1023
908
|
this.signInResolver = options.signInResolver;
|
|
1024
909
|
this.authHandler = options.authHandler;
|
|
1025
910
|
this.resolverContext = options.resolverContext;
|
|
@@ -1187,10 +1072,10 @@ const commonByEmailResolver = async (info, ctx) => {
|
|
|
1187
1072
|
});
|
|
1188
1073
|
};
|
|
1189
1074
|
|
|
1190
|
-
var __defProp$
|
|
1191
|
-
var __defNormalProp$
|
|
1192
|
-
var __publicField$
|
|
1193
|
-
__defNormalProp$
|
|
1075
|
+
var __defProp$c = Object.defineProperty;
|
|
1076
|
+
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1077
|
+
var __publicField$c = (obj, key, value) => {
|
|
1078
|
+
__defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1194
1079
|
return value;
|
|
1195
1080
|
};
|
|
1196
1081
|
const CF_JWT_HEADER = "cf-access-jwt-assertion";
|
|
@@ -1198,12 +1083,12 @@ const COOKIE_AUTH_NAME = "CF_Authorization";
|
|
|
1198
1083
|
const CACHE_PREFIX = "providers/cloudflare-access/profile-v1";
|
|
1199
1084
|
class CloudflareAccessAuthProvider {
|
|
1200
1085
|
constructor(options) {
|
|
1201
|
-
__publicField$
|
|
1202
|
-
__publicField$
|
|
1203
|
-
__publicField$
|
|
1204
|
-
__publicField$
|
|
1205
|
-
__publicField$
|
|
1206
|
-
__publicField$
|
|
1086
|
+
__publicField$c(this, "teamName");
|
|
1087
|
+
__publicField$c(this, "resolverContext");
|
|
1088
|
+
__publicField$c(this, "authHandler");
|
|
1089
|
+
__publicField$c(this, "signInResolver");
|
|
1090
|
+
__publicField$c(this, "jwtKeySet");
|
|
1091
|
+
__publicField$c(this, "cache");
|
|
1207
1092
|
this.teamName = options.teamName;
|
|
1208
1093
|
this.authHandler = options.authHandler;
|
|
1209
1094
|
this.signInResolver = options.signInResolver;
|
|
@@ -1406,70 +1291,6 @@ const github = createAuthProviderIntegration({
|
|
|
1406
1291
|
}
|
|
1407
1292
|
});
|
|
1408
1293
|
|
|
1409
|
-
function adaptLegacyOAuthHandler(authHandler) {
|
|
1410
|
-
return authHandler && (async (result, ctx) => authHandler(
|
|
1411
|
-
{
|
|
1412
|
-
fullProfile: result.fullProfile,
|
|
1413
|
-
accessToken: result.session.accessToken,
|
|
1414
|
-
params: {
|
|
1415
|
-
scope: result.session.scope,
|
|
1416
|
-
id_token: result.session.idToken,
|
|
1417
|
-
token_type: result.session.tokenType,
|
|
1418
|
-
expires_in: result.session.expiresInSeconds
|
|
1419
|
-
}
|
|
1420
|
-
},
|
|
1421
|
-
ctx
|
|
1422
|
-
));
|
|
1423
|
-
}
|
|
1424
|
-
|
|
1425
|
-
function adaptLegacyOAuthSignInResolver(signInResolver) {
|
|
1426
|
-
return signInResolver && (async (input, ctx) => signInResolver(
|
|
1427
|
-
{
|
|
1428
|
-
profile: input.profile,
|
|
1429
|
-
result: {
|
|
1430
|
-
fullProfile: input.result.fullProfile,
|
|
1431
|
-
accessToken: input.result.session.accessToken,
|
|
1432
|
-
refreshToken: input.result.session.refreshToken,
|
|
1433
|
-
params: {
|
|
1434
|
-
scope: input.result.session.scope,
|
|
1435
|
-
id_token: input.result.session.idToken,
|
|
1436
|
-
token_type: input.result.session.tokenType,
|
|
1437
|
-
expires_in: input.result.session.expiresInSeconds
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
},
|
|
1441
|
-
ctx
|
|
1442
|
-
));
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
function adaptOAuthSignInResolverToLegacy(resolvers) {
|
|
1446
|
-
const legacyResolvers = {};
|
|
1447
|
-
for (const name of Object.keys(resolvers)) {
|
|
1448
|
-
const resolver = resolvers[name];
|
|
1449
|
-
legacyResolvers[name] = () => async (input, ctx) => {
|
|
1450
|
-
var _a;
|
|
1451
|
-
return resolver(
|
|
1452
|
-
{
|
|
1453
|
-
profile: input.profile,
|
|
1454
|
-
result: {
|
|
1455
|
-
fullProfile: input.result.fullProfile,
|
|
1456
|
-
session: {
|
|
1457
|
-
accessToken: input.result.accessToken,
|
|
1458
|
-
expiresInSeconds: input.result.params.expires_in,
|
|
1459
|
-
scope: input.result.params.scope,
|
|
1460
|
-
idToken: input.result.params.id_token,
|
|
1461
|
-
tokenType: (_a = input.result.params.token_type) != null ? _a : "bearer",
|
|
1462
|
-
refreshToken: input.result.refreshToken
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
},
|
|
1466
|
-
ctx
|
|
1467
|
-
);
|
|
1468
|
-
};
|
|
1469
|
-
}
|
|
1470
|
-
return legacyResolvers;
|
|
1471
|
-
}
|
|
1472
|
-
|
|
1473
1294
|
const gitlab = createAuthProviderIntegration({
|
|
1474
1295
|
create(options) {
|
|
1475
1296
|
var _a;
|
|
@@ -1499,20 +1320,20 @@ const google = createAuthProviderIntegration({
|
|
|
1499
1320
|
|
|
1500
1321
|
const BACKSTAGE_SESSION_EXPIRATION = 3600;
|
|
1501
1322
|
|
|
1502
|
-
var __defProp$
|
|
1503
|
-
var __defNormalProp$
|
|
1504
|
-
var __publicField$
|
|
1505
|
-
__defNormalProp$
|
|
1323
|
+
var __defProp$b = Object.defineProperty;
|
|
1324
|
+
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1325
|
+
var __publicField$b = (obj, key, value) => {
|
|
1326
|
+
__defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1506
1327
|
return value;
|
|
1507
1328
|
};
|
|
1508
1329
|
class MicrosoftAuthProvider {
|
|
1509
1330
|
constructor(options) {
|
|
1510
|
-
__publicField$
|
|
1511
|
-
__publicField$
|
|
1512
|
-
__publicField$
|
|
1513
|
-
__publicField$
|
|
1514
|
-
__publicField$
|
|
1515
|
-
__publicField$
|
|
1331
|
+
__publicField$b(this, "_strategy");
|
|
1332
|
+
__publicField$b(this, "signInResolver");
|
|
1333
|
+
__publicField$b(this, "authHandler");
|
|
1334
|
+
__publicField$b(this, "logger");
|
|
1335
|
+
__publicField$b(this, "resolverContext");
|
|
1336
|
+
__publicField$b(this, "skipUserProfile", (accessToken) => {
|
|
1516
1337
|
const { aud, scp } = jose.decodeJwt(accessToken);
|
|
1517
1338
|
const hasGraphReadScope = aud === "00000003-0000-0000-c000-000000000000" && scp.split(" ").map((s) => s.toLowerCase()).includes("user.read");
|
|
1518
1339
|
return !hasGraphReadScope;
|
|
@@ -1688,18 +1509,18 @@ const oauth2 = createAuthProviderIntegration({
|
|
|
1688
1509
|
}
|
|
1689
1510
|
});
|
|
1690
1511
|
|
|
1691
|
-
var __defProp$
|
|
1692
|
-
var __defNormalProp$
|
|
1693
|
-
var __publicField$
|
|
1694
|
-
__defNormalProp$
|
|
1512
|
+
var __defProp$a = Object.defineProperty;
|
|
1513
|
+
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1514
|
+
var __publicField$a = (obj, key, value) => {
|
|
1515
|
+
__defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1695
1516
|
return value;
|
|
1696
1517
|
};
|
|
1697
1518
|
const OAUTH2_PROXY_JWT_HEADER = "X-OAUTH2-PROXY-ID-TOKEN";
|
|
1698
1519
|
class Oauth2ProxyAuthProvider {
|
|
1699
1520
|
constructor(options) {
|
|
1700
|
-
__publicField$
|
|
1701
|
-
__publicField$
|
|
1702
|
-
__publicField$
|
|
1521
|
+
__publicField$a(this, "resolverContext");
|
|
1522
|
+
__publicField$a(this, "signInResolver");
|
|
1523
|
+
__publicField$a(this, "authHandler");
|
|
1703
1524
|
this.resolverContext = options.resolverContext;
|
|
1704
1525
|
this.signInResolver = options.signInResolver;
|
|
1705
1526
|
this.authHandler = options.authHandler;
|
|
@@ -1774,20 +1595,20 @@ const oauth2Proxy = createAuthProviderIntegration({
|
|
|
1774
1595
|
}
|
|
1775
1596
|
});
|
|
1776
1597
|
|
|
1777
|
-
var __defProp$
|
|
1778
|
-
var __defNormalProp$
|
|
1779
|
-
var __publicField$
|
|
1780
|
-
__defNormalProp$
|
|
1598
|
+
var __defProp$9 = Object.defineProperty;
|
|
1599
|
+
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1600
|
+
var __publicField$9 = (obj, key, value) => {
|
|
1601
|
+
__defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1781
1602
|
return value;
|
|
1782
1603
|
};
|
|
1783
1604
|
class OidcAuthProvider {
|
|
1784
1605
|
constructor(options) {
|
|
1785
|
-
__publicField$
|
|
1786
|
-
__publicField$
|
|
1787
|
-
__publicField$
|
|
1788
|
-
__publicField$
|
|
1789
|
-
__publicField$
|
|
1790
|
-
__publicField$
|
|
1606
|
+
__publicField$9(this, "implementation");
|
|
1607
|
+
__publicField$9(this, "scope");
|
|
1608
|
+
__publicField$9(this, "prompt");
|
|
1609
|
+
__publicField$9(this, "signInResolver");
|
|
1610
|
+
__publicField$9(this, "authHandler");
|
|
1611
|
+
__publicField$9(this, "resolverContext");
|
|
1791
1612
|
this.implementation = this.setupStrategy(options);
|
|
1792
1613
|
this.scope = options.scope;
|
|
1793
1614
|
this.prompt = options.prompt;
|
|
@@ -1948,168 +1769,16 @@ const oidc = createAuthProviderIntegration({
|
|
|
1948
1769
|
}
|
|
1949
1770
|
});
|
|
1950
1771
|
|
|
1951
|
-
var __defProp$9 = Object.defineProperty;
|
|
1952
|
-
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1953
|
-
var __publicField$9 = (obj, key, value) => {
|
|
1954
|
-
__defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
1955
|
-
return value;
|
|
1956
|
-
};
|
|
1957
|
-
class OktaAuthProvider {
|
|
1958
|
-
constructor(options) {
|
|
1959
|
-
__publicField$9(this, "strategy");
|
|
1960
|
-
__publicField$9(this, "signInResolver");
|
|
1961
|
-
__publicField$9(this, "authHandler");
|
|
1962
|
-
__publicField$9(this, "resolverContext");
|
|
1963
|
-
/**
|
|
1964
|
-
* Due to passport-okta-oauth forcing options.state = true,
|
|
1965
|
-
* passport-oauth2 requires express-session to be installed
|
|
1966
|
-
* so that the 'state' parameter of the oauth2 flow can be stored.
|
|
1967
|
-
* This implementation of StateStore matches the NullStore found within
|
|
1968
|
-
* passport-oauth2, which is the StateStore implementation used when options.state = false,
|
|
1969
|
-
* allowing us to avoid using express-session in order to integrate with Okta.
|
|
1970
|
-
*/
|
|
1971
|
-
__publicField$9(this, "store", {
|
|
1972
|
-
store(_req, cb) {
|
|
1973
|
-
cb(null, null);
|
|
1974
|
-
},
|
|
1975
|
-
verify(_req, _state, cb) {
|
|
1976
|
-
cb(null, true);
|
|
1977
|
-
}
|
|
1978
|
-
});
|
|
1979
|
-
this.signInResolver = options.signInResolver;
|
|
1980
|
-
this.authHandler = options.authHandler;
|
|
1981
|
-
this.resolverContext = options.resolverContext;
|
|
1982
|
-
this.strategy = new passportOktaOauth.Strategy(
|
|
1983
|
-
{
|
|
1984
|
-
clientID: options.clientId,
|
|
1985
|
-
clientSecret: options.clientSecret,
|
|
1986
|
-
callbackURL: options.callbackUrl,
|
|
1987
|
-
audience: options.audience,
|
|
1988
|
-
authServerID: options.authServerId,
|
|
1989
|
-
idp: options.idp,
|
|
1990
|
-
passReqToCallback: false,
|
|
1991
|
-
store: this.store,
|
|
1992
|
-
response_type: "code"
|
|
1993
|
-
},
|
|
1994
|
-
(accessToken, refreshToken, params, fullProfile, done) => {
|
|
1995
|
-
done(
|
|
1996
|
-
void 0,
|
|
1997
|
-
{
|
|
1998
|
-
accessToken,
|
|
1999
|
-
refreshToken,
|
|
2000
|
-
params,
|
|
2001
|
-
fullProfile
|
|
2002
|
-
},
|
|
2003
|
-
{
|
|
2004
|
-
refreshToken
|
|
2005
|
-
}
|
|
2006
|
-
);
|
|
2007
|
-
}
|
|
2008
|
-
);
|
|
2009
|
-
}
|
|
2010
|
-
async start(req) {
|
|
2011
|
-
return await executeRedirectStrategy(req, this.strategy, {
|
|
2012
|
-
accessType: "offline",
|
|
2013
|
-
prompt: "consent",
|
|
2014
|
-
scope: req.scope,
|
|
2015
|
-
state: encodeState(req.state)
|
|
2016
|
-
});
|
|
2017
|
-
}
|
|
2018
|
-
async handler(req) {
|
|
2019
|
-
const { result, privateInfo } = await executeFrameHandlerStrategy(req, this.strategy);
|
|
2020
|
-
return {
|
|
2021
|
-
response: await this.handleResult(result),
|
|
2022
|
-
refreshToken: privateInfo.refreshToken
|
|
2023
|
-
};
|
|
2024
|
-
}
|
|
2025
|
-
async refresh(req) {
|
|
2026
|
-
const { accessToken, refreshToken, params } = await executeRefreshTokenStrategy(
|
|
2027
|
-
this.strategy,
|
|
2028
|
-
req.refreshToken,
|
|
2029
|
-
req.scope
|
|
2030
|
-
);
|
|
2031
|
-
const fullProfile = await executeFetchUserProfileStrategy(
|
|
2032
|
-
this.strategy,
|
|
2033
|
-
accessToken
|
|
2034
|
-
);
|
|
2035
|
-
return {
|
|
2036
|
-
response: await this.handleResult({
|
|
2037
|
-
fullProfile,
|
|
2038
|
-
params,
|
|
2039
|
-
accessToken
|
|
2040
|
-
}),
|
|
2041
|
-
refreshToken
|
|
2042
|
-
};
|
|
2043
|
-
}
|
|
2044
|
-
async handleResult(result) {
|
|
2045
|
-
const { profile } = await this.authHandler(result, this.resolverContext);
|
|
2046
|
-
const response = {
|
|
2047
|
-
providerInfo: {
|
|
2048
|
-
idToken: result.params.id_token,
|
|
2049
|
-
accessToken: result.accessToken,
|
|
2050
|
-
scope: result.params.scope,
|
|
2051
|
-
expiresInSeconds: result.params.expires_in
|
|
2052
|
-
},
|
|
2053
|
-
profile
|
|
2054
|
-
};
|
|
2055
|
-
if (this.signInResolver) {
|
|
2056
|
-
response.backstageIdentity = await this.signInResolver(
|
|
2057
|
-
{
|
|
2058
|
-
result,
|
|
2059
|
-
profile
|
|
2060
|
-
},
|
|
2061
|
-
this.resolverContext
|
|
2062
|
-
);
|
|
2063
|
-
}
|
|
2064
|
-
return response;
|
|
2065
|
-
}
|
|
2066
|
-
}
|
|
2067
1772
|
const okta = createAuthProviderIntegration({
|
|
2068
1773
|
create(options) {
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
const authServerId = envConfig.getOptionalString("authServerId");
|
|
2075
|
-
const idp = envConfig.getOptionalString("idp");
|
|
2076
|
-
const customCallbackUrl = envConfig.getOptionalString("callbackUrl");
|
|
2077
|
-
const callbackUrl = customCallbackUrl || `${globalConfig.baseUrl}/${providerId}/handler/frame`;
|
|
2078
|
-
if (!audience.startsWith("https://")) {
|
|
2079
|
-
throw new Error("URL for 'audience' must start with 'https://'.");
|
|
2080
|
-
}
|
|
2081
|
-
const authHandler = (options == null ? void 0 : options.authHandler) ? options.authHandler : async ({ fullProfile, params }) => ({
|
|
2082
|
-
profile: makeProfileInfo(fullProfile, params.id_token)
|
|
2083
|
-
});
|
|
2084
|
-
const provider = new OktaAuthProvider({
|
|
2085
|
-
audience,
|
|
2086
|
-
authServerId,
|
|
2087
|
-
idp,
|
|
2088
|
-
clientId,
|
|
2089
|
-
clientSecret,
|
|
2090
|
-
callbackUrl,
|
|
2091
|
-
authHandler,
|
|
2092
|
-
signInResolver: (_a = options == null ? void 0 : options.signIn) == null ? void 0 : _a.resolver,
|
|
2093
|
-
resolverContext
|
|
2094
|
-
});
|
|
2095
|
-
return OAuthAdapter.fromConfig(globalConfig, provider, {
|
|
2096
|
-
providerId,
|
|
2097
|
-
callbackUrl
|
|
2098
|
-
});
|
|
1774
|
+
var _a;
|
|
1775
|
+
return pluginAuthNode.createOAuthProviderFactory({
|
|
1776
|
+
authenticator: pluginAuthBackendModuleOktaProvider.oktaAuthenticator,
|
|
1777
|
+
profileTransform: adaptLegacyOAuthHandler(options == null ? void 0 : options.authHandler),
|
|
1778
|
+
signInResolver: adaptLegacyOAuthSignInResolver((_a = options == null ? void 0 : options.signIn) == null ? void 0 : _a.resolver)
|
|
2099
1779
|
});
|
|
2100
1780
|
},
|
|
2101
1781
|
resolvers: {
|
|
2102
|
-
/**
|
|
2103
|
-
* Looks up the user by matching their email local part to the entity name.
|
|
2104
|
-
*/
|
|
2105
|
-
emailLocalPartMatchingUserEntityName: () => commonByEmailLocalPartResolver,
|
|
2106
|
-
/**
|
|
2107
|
-
* Looks up the user by matching their email to the entity email.
|
|
2108
|
-
*/
|
|
2109
|
-
emailMatchingUserEntityProfileEmail: () => commonByEmailResolver,
|
|
2110
|
-
/**
|
|
2111
|
-
* Looks up the user by matching their email to the `okta.com/email` annotation.
|
|
2112
|
-
*/
|
|
2113
1782
|
emailMatchingUserEntityAnnotation() {
|
|
2114
1783
|
return async (info, ctx) => {
|
|
2115
1784
|
const { profile } = info;
|
|
@@ -2378,7 +2047,7 @@ class BitbucketServerAuthProvider {
|
|
|
2378
2047
|
this.signInResolver = options.signInResolver;
|
|
2379
2048
|
this.authHandler = options.authHandler;
|
|
2380
2049
|
this.resolverContext = options.resolverContext;
|
|
2381
|
-
this.strategy = new
|
|
2050
|
+
this.strategy = new passportOauth2.Strategy(
|
|
2382
2051
|
{
|
|
2383
2052
|
authorizationURL: options.authorizationUrl,
|
|
2384
2053
|
tokenURL: options.tokenUrl,
|