@celljs/oauth2-core 3.0.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/LICENSE +21 -0
- package/README.md +1 -0
- package/cell.yml +0 -0
- package/lib/node/authentication/authentication-protocol.d.ts +11 -0
- package/lib/node/authentication/authentication-protocol.d.ts.map +1 -0
- package/lib/node/authentication/authentication-protocol.js +16 -0
- package/lib/node/authentication/authentication-protocol.js.map +1 -0
- package/lib/node/authentication/index.d.ts +2 -0
- package/lib/node/authentication/index.d.ts.map +1 -0
- package/lib/node/authentication/index.js +18 -0
- package/lib/node/authentication/index.js.map +1 -0
- package/lib/node/authorization/authorization-protocol.d.ts +12 -0
- package/lib/node/authorization/authorization-protocol.d.ts.map +1 -0
- package/lib/node/authorization/authorization-protocol.js +17 -0
- package/lib/node/authorization/authorization-protocol.js.map +1 -0
- package/lib/node/authorization/index.d.ts +2 -0
- package/lib/node/authorization/index.d.ts.map +1 -0
- package/lib/node/authorization/index.js +18 -0
- package/lib/node/authorization/index.js.map +1 -0
- package/lib/node/endpoint/access-token-response-converter.d.ts +17 -0
- package/lib/node/endpoint/access-token-response-converter.d.ts.map +1 -0
- package/lib/node/endpoint/access-token-response-converter.js +70 -0
- package/lib/node/endpoint/access-token-response-converter.js.map +1 -0
- package/lib/node/endpoint/endpoint-protocol.d.ts +129 -0
- package/lib/node/endpoint/endpoint-protocol.d.ts.map +1 -0
- package/lib/node/endpoint/endpoint-protocol.js +97 -0
- package/lib/node/endpoint/endpoint-protocol.js.map +1 -0
- package/lib/node/endpoint/index.d.ts +3 -0
- package/lib/node/endpoint/index.d.ts.map +1 -0
- package/lib/node/endpoint/index.js +19 -0
- package/lib/node/endpoint/index.js.map +1 -0
- package/lib/node/error/error-protocol.d.ts +81 -0
- package/lib/node/error/error-protocol.d.ts.map +1 -0
- package/lib/node/error/error-protocol.js +85 -0
- package/lib/node/error/error-protocol.js.map +1 -0
- package/lib/node/error/error.d.ts +12 -0
- package/lib/node/error/error.d.ts.map +1 -0
- package/lib/node/error/error.js +20 -0
- package/lib/node/error/error.js.map +1 -0
- package/lib/node/error/index.d.ts +3 -0
- package/lib/node/error/index.d.ts.map +1 -0
- package/lib/node/error/index.js +19 -0
- package/lib/node/error/index.js.map +1 -0
- package/lib/node/index.d.ts +7 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +23 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/module.d.ts +4 -0
- package/lib/node/module.d.ts.map +1 -0
- package/lib/node/module.js +6 -0
- package/lib/node/module.js.map +1 -0
- package/lib/node/oidc/index.d.ts +2 -0
- package/lib/node/oidc/index.d.ts.map +1 -0
- package/lib/node/oidc/index.js +18 -0
- package/lib/node/oidc/index.js.map +1 -0
- package/lib/node/oidc/oidc-protocol.d.ts +117 -0
- package/lib/node/oidc/oidc-protocol.d.ts.map +1 -0
- package/lib/node/oidc/oidc-protocol.js +123 -0
- package/lib/node/oidc/oidc-protocol.js.map +1 -0
- package/lib/node/token/index.d.ts +2 -0
- package/lib/node/token/index.d.ts.map +1 -0
- package/lib/node/token/index.js +18 -0
- package/lib/node/token/index.js.map +1 -0
- package/lib/node/token/token-protocol.d.ts +66 -0
- package/lib/node/token/token-protocol.d.ts.map +1 -0
- package/lib/node/token/token-protocol.js +60 -0
- package/lib/node/token/token-protocol.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +4 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +45 -0
- package/src/node/authentication/authentication-protocol.ts +11 -0
- package/src/node/authentication/index.ts +1 -0
- package/src/node/authorization/authorization-protocol.ts +12 -0
- package/src/node/authorization/index.ts +1 -0
- package/src/node/endpoint/access-token-response-converter.ts +64 -0
- package/src/node/endpoint/endpoint-protocol.ts +150 -0
- package/src/node/endpoint/index.ts +2 -0
- package/src/node/error/error-protocol.ts +93 -0
- package/src/node/error/error.ts +19 -0
- package/src/node/error/index.ts +2 -0
- package/src/node/index.ts +6 -0
- package/src/node/module.ts +4 -0
- package/src/node/oidc/index.ts +1 -0
- package/src/node/oidc/oidc-protocol.ts +148 -0
- package/src/node/token/index.ts +1 -0
- package/src/node/token/token-protocol.ts +81 -0
- package/src/package.spec.ts +4 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Cellbang
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Cell - Oauth2 Core Component
|
package/cell.yml
ADDED
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum AuthenticationMethod {
|
|
2
|
+
Header = "header",
|
|
3
|
+
Form = "form",
|
|
4
|
+
Query = "query"
|
|
5
|
+
}
|
|
6
|
+
export declare enum ClientAuthenticationMethod {
|
|
7
|
+
Basic = "basic",
|
|
8
|
+
Post = "post",
|
|
9
|
+
None = "none"
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=authentication-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication-protocol.d.ts","sourceRoot":"","sources":["../../../src/node/authentication/authentication-protocol.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC5B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,KAAK,UAAU;CAClB;AAED,oBAAY,0BAA0B;IAClC,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CAChB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ClientAuthenticationMethod = exports.AuthenticationMethod = void 0;
|
|
4
|
+
var AuthenticationMethod;
|
|
5
|
+
(function (AuthenticationMethod) {
|
|
6
|
+
AuthenticationMethod["Header"] = "header";
|
|
7
|
+
AuthenticationMethod["Form"] = "form";
|
|
8
|
+
AuthenticationMethod["Query"] = "query";
|
|
9
|
+
})(AuthenticationMethod = exports.AuthenticationMethod || (exports.AuthenticationMethod = {}));
|
|
10
|
+
var ClientAuthenticationMethod;
|
|
11
|
+
(function (ClientAuthenticationMethod) {
|
|
12
|
+
ClientAuthenticationMethod["Basic"] = "basic";
|
|
13
|
+
ClientAuthenticationMethod["Post"] = "post";
|
|
14
|
+
ClientAuthenticationMethod["None"] = "none";
|
|
15
|
+
})(ClientAuthenticationMethod = exports.ClientAuthenticationMethod || (exports.ClientAuthenticationMethod = {}));
|
|
16
|
+
//# sourceMappingURL=authentication-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication-protocol.js","sourceRoot":"","sources":["../../../src/node/authentication/authentication-protocol.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC5B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,uCAAe,CAAA;AACnB,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAED,IAAY,0BAIX;AAJD,WAAY,0BAA0B;IAClC,6CAAe,CAAA;IACf,2CAAa,CAAA;IACb,2CAAa,CAAA;AACjB,CAAC,EAJW,0BAA0B,GAA1B,kCAA0B,KAA1B,kCAA0B,QAIrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/authentication/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./authentication-protocol"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/authentication/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAA0C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum AuthorizationGrantType {
|
|
2
|
+
AuthorizationCode = "authorization_code",
|
|
3
|
+
Implicit = "implicit",
|
|
4
|
+
RefreshToken = "refresh_token",
|
|
5
|
+
ClientCredentials = "client_credentials",
|
|
6
|
+
Password = "password"
|
|
7
|
+
}
|
|
8
|
+
export declare enum AuthorizationResponseType {
|
|
9
|
+
Code = "code",
|
|
10
|
+
Token = "token"
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=authorization-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization-protocol.d.ts","sourceRoot":"","sources":["../../../src/node/authorization/authorization-protocol.ts"],"names":[],"mappings":"AAAA,oBAAY,sBAAsB;IAC9B,iBAAiB,uBAAuB;IACxC,QAAQ,aAAa;IACrB,YAAY,kBAAkB;IAC9B,iBAAiB,uBAAuB;IACxC,QAAQ,aAAa;CACxB;AAED,oBAAY,yBAAyB;IACjC,IAAI,SAAS;IACb,KAAK,UAAU;CAClB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthorizationResponseType = exports.AuthorizationGrantType = void 0;
|
|
4
|
+
var AuthorizationGrantType;
|
|
5
|
+
(function (AuthorizationGrantType) {
|
|
6
|
+
AuthorizationGrantType["AuthorizationCode"] = "authorization_code";
|
|
7
|
+
AuthorizationGrantType["Implicit"] = "implicit";
|
|
8
|
+
AuthorizationGrantType["RefreshToken"] = "refresh_token";
|
|
9
|
+
AuthorizationGrantType["ClientCredentials"] = "client_credentials";
|
|
10
|
+
AuthorizationGrantType["Password"] = "password";
|
|
11
|
+
})(AuthorizationGrantType = exports.AuthorizationGrantType || (exports.AuthorizationGrantType = {}));
|
|
12
|
+
var AuthorizationResponseType;
|
|
13
|
+
(function (AuthorizationResponseType) {
|
|
14
|
+
AuthorizationResponseType["Code"] = "code";
|
|
15
|
+
AuthorizationResponseType["Token"] = "token";
|
|
16
|
+
})(AuthorizationResponseType = exports.AuthorizationResponseType || (exports.AuthorizationResponseType = {}));
|
|
17
|
+
//# sourceMappingURL=authorization-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authorization-protocol.js","sourceRoot":"","sources":["../../../src/node/authorization/authorization-protocol.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAC9B,kEAAwC,CAAA;IACxC,+CAAqB,CAAA;IACrB,wDAA8B,CAAA;IAC9B,kEAAwC,CAAA;IACxC,+CAAqB,CAAA;AACzB,CAAC,EANW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAMjC;AAED,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACjC,0CAAa,CAAA;IACb,4CAAe,CAAA;AACnB,CAAC,EAHW,yBAAyB,GAAzB,iCAAyB,KAAzB,iCAAyB,QAGpC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/authorization/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./authorization-protocol"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/authorization/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TokenType } from '../token';
|
|
2
|
+
import { AccessTokenResponse } from './endpoint-protocol';
|
|
3
|
+
export declare class AccessTokenResponseConverter {
|
|
4
|
+
convert(tokenResponse: {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}): AccessTokenResponse;
|
|
7
|
+
protected getScopes(tokenResponse: {
|
|
8
|
+
[key: string]: string;
|
|
9
|
+
}): string[];
|
|
10
|
+
protected getExpiresIn(tokenResponse: {
|
|
11
|
+
[key: string]: string;
|
|
12
|
+
}): number;
|
|
13
|
+
protected getAccessTokenType(tokenResponse: {
|
|
14
|
+
[key: string]: string;
|
|
15
|
+
}): TokenType.Bearer | undefined;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=access-token-response-converter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-token-response-converter.d.ts","sourceRoot":"","sources":["../../../src/node/endpoint/access-token-response-converter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,mBAAmB,EAAwB,MAAM,qBAAqB,CAAC;AAGhF,qBACa,4BAA4B;IACrC,OAAO,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,mBAAmB;IAsCtE,SAAS,CAAC,SAAS,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE;IAO7D,SAAS,CAAC,YAAY,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE;IAOhE,SAAS,CAAC,kBAAkB,CAAC,aAAa,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;KAAE;CAKzE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var AccessTokenResponseConverter_1;
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.AccessTokenResponseConverter = void 0;
|
|
11
|
+
const token_1 = require("../token");
|
|
12
|
+
const endpoint_protocol_1 = require("./endpoint-protocol");
|
|
13
|
+
const core_1 = require("@celljs/core");
|
|
14
|
+
let AccessTokenResponseConverter = AccessTokenResponseConverter_1 = class AccessTokenResponseConverter {
|
|
15
|
+
convert(tokenResponse) {
|
|
16
|
+
const accessToken = tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.ACCESS_TOKEN];
|
|
17
|
+
const tokenType = this.getAccessTokenType(tokenResponse);
|
|
18
|
+
const expiresIn = this.getExpiresIn(tokenResponse);
|
|
19
|
+
const scopes = this.getScopes(tokenResponse);
|
|
20
|
+
const refreshToken = tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.REFRESH_TOKEN];
|
|
21
|
+
const checkParameters = [
|
|
22
|
+
endpoint_protocol_1.OAuth2ParameterNames.ACCESS_TOKEN,
|
|
23
|
+
endpoint_protocol_1.OAuth2ParameterNames.EXPIRES_IN,
|
|
24
|
+
endpoint_protocol_1.OAuth2ParameterNames.REFRESH_TOKEN,
|
|
25
|
+
endpoint_protocol_1.OAuth2ParameterNames.SCOPE,
|
|
26
|
+
endpoint_protocol_1.OAuth2ParameterNames.TOKEN_TYPE
|
|
27
|
+
];
|
|
28
|
+
const additionalParameters = {};
|
|
29
|
+
for (const key in tokenResponse) {
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(tokenResponse, key) && !checkParameters.includes(key)) {
|
|
31
|
+
additionalParameters[key] = tokenResponse[key];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
const issuedAt = Date.now();
|
|
35
|
+
const expiresAt = expiresIn > 0 ? issuedAt + 1000 * expiresIn : issuedAt + 1000;
|
|
36
|
+
return {
|
|
37
|
+
accessToken: {
|
|
38
|
+
tokenType,
|
|
39
|
+
issuedAt,
|
|
40
|
+
expiresAt,
|
|
41
|
+
tokenValue: accessToken,
|
|
42
|
+
scopes
|
|
43
|
+
},
|
|
44
|
+
refreshToken: refreshToken ? { tokenValue: refreshToken, issuedAt } : undefined,
|
|
45
|
+
additionalParameters
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
getScopes(tokenResponse) {
|
|
49
|
+
if (tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.SCOPE]) {
|
|
50
|
+
return tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.SCOPE].split(' ');
|
|
51
|
+
}
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
getExpiresIn(tokenResponse) {
|
|
55
|
+
if (tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.EXPIRES_IN]) {
|
|
56
|
+
return parseInt(tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.EXPIRES_IN]);
|
|
57
|
+
}
|
|
58
|
+
return 0;
|
|
59
|
+
}
|
|
60
|
+
getAccessTokenType(tokenResponse) {
|
|
61
|
+
if (token_1.TokenType.Bearer.toUpperCase() === (tokenResponse[endpoint_protocol_1.OAuth2ParameterNames.TOKEN_TYPE] || '').toUpperCase()) {
|
|
62
|
+
return token_1.TokenType.Bearer;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
AccessTokenResponseConverter = AccessTokenResponseConverter_1 = __decorate([
|
|
67
|
+
(0, core_1.Component)(AccessTokenResponseConverter_1)
|
|
68
|
+
], AccessTokenResponseConverter);
|
|
69
|
+
exports.AccessTokenResponseConverter = AccessTokenResponseConverter;
|
|
70
|
+
//# sourceMappingURL=access-token-response-converter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"access-token-response-converter.js","sourceRoot":"","sources":["../../../src/node/endpoint/access-token-response-converter.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,oCAAqC;AACrC,2DAAgF;AAChF,uCAAyC;AAGlC,IAAM,4BAA4B,oCAAlC,MAAM,4BAA4B;IACrC,OAAO,CAAC,aAAwC;QAC5C,MAAM,WAAW,GAAG,aAAa,CAAC,wCAAoB,CAAC,YAAY,CAAC,CAAC;QACrE,MAAM,SAAS,GAAG,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAC7C,MAAM,YAAY,GAAG,aAAa,CAAC,wCAAoB,CAAC,aAAa,CAAC,CAAC;QAEvE,MAAM,eAAe,GAAG;YACpB,wCAAoB,CAAC,YAAY;YACjC,wCAAoB,CAAC,UAAU;YAC/B,wCAAoB,CAAC,aAAa;YAClC,wCAAoB,CAAC,KAAK;YAC1B,wCAAoB,CAAC,UAAU;SAClC,CAAC;QACF,MAAM,oBAAoB,GAA8B,EAAE,CAAC;QAC3D,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;YAC7B,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBAC5F,oBAAoB,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;aAClD;SACJ;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC5B,MAAM,SAAS,GAAG,SAAS,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,GAAG,IAAI,CAAC;QAEhF,OAAO;YACH,WAAW,EAAE;gBACT,SAAS;gBACT,QAAQ;gBACR,SAAS;gBACT,UAAU,EAAE,WAAW;gBACvB,MAAM;aACT;YACD,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS;YAC/E,oBAAoB;SACvB,CAAC;IAEN,CAAC;IAES,SAAS,CAAC,aAAyC;QACzD,IAAI,aAAa,CAAC,wCAAoB,CAAC,KAAK,CAAC,EAAE;YAC3C,OAAO,aAAa,CAAC,wCAAoB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC/D;QACD,OAAO,EAAE,CAAC;IACd,CAAC;IAES,YAAY,CAAC,aAAyC;QAC5D,IAAI,aAAa,CAAC,wCAAoB,CAAC,UAAU,CAAC,EAAE;YAChD,OAAO,QAAQ,CAAC,aAAa,CAAC,wCAAoB,CAAC,UAAU,CAAC,CAAC,CAAC;SACnE;QACD,OAAO,CAAC,CAAC;IACb,CAAC;IAES,kBAAkB,CAAC,aAAyC;QAClE,IAAI,iBAAS,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,wCAAoB,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE;YACzG,OAAO,iBAAS,CAAC,MAAM,CAAC;SAC3B;IACL,CAAC;CACJ,CAAA;AA1DY,4BAA4B;IADxC,IAAA,gBAAS,EAAC,8BAA4B,CAAC;GAC3B,4BAA4B,CA0DxC;AA1DY,oEAA4B"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { AuthorizationGrantType, AuthorizationResponseType } from '../authorization';
|
|
2
|
+
import { RefreshToken, AccessToken } from '../token';
|
|
3
|
+
export declare namespace OAuth2ParameterNames {
|
|
4
|
+
/**
|
|
5
|
+
* used in Access Token Request.
|
|
6
|
+
*/
|
|
7
|
+
const GRANT_TYPE = "grant_type";
|
|
8
|
+
/**
|
|
9
|
+
* used in Authorization Request.
|
|
10
|
+
*/
|
|
11
|
+
const RESPONSE_TYPE = "response_type";
|
|
12
|
+
/**
|
|
13
|
+
* used in Authorization Request and Access Token Request.
|
|
14
|
+
*/
|
|
15
|
+
const CLIENT_ID = "client_id";
|
|
16
|
+
/**
|
|
17
|
+
* used in Access Token Request.
|
|
18
|
+
*/
|
|
19
|
+
const CLIENT_SECRET = "client_secret";
|
|
20
|
+
/**
|
|
21
|
+
* used in Authorization Request and Access Token Request.
|
|
22
|
+
*/
|
|
23
|
+
const REDIRECT_URI = "redirect_uri";
|
|
24
|
+
/**
|
|
25
|
+
* used in Authorization Request, Authorization Response, Access Token Request and Access Token Response.
|
|
26
|
+
*/
|
|
27
|
+
const SCOPE = "scope";
|
|
28
|
+
/**
|
|
29
|
+
* used in Authorization Request and Authorization Response.
|
|
30
|
+
*/
|
|
31
|
+
const STATE = "state";
|
|
32
|
+
/**
|
|
33
|
+
* used in Authorization Response and Access Token Request.
|
|
34
|
+
*/
|
|
35
|
+
const CODE = "code";
|
|
36
|
+
/**
|
|
37
|
+
* used in Authorization Response and Access Token Response.
|
|
38
|
+
*/
|
|
39
|
+
const ACCESS_TOKEN = "access_token";
|
|
40
|
+
/**
|
|
41
|
+
* used in Authorization Response and Access Token Response.
|
|
42
|
+
*/
|
|
43
|
+
const TOKEN_TYPE = "token_type";
|
|
44
|
+
/**
|
|
45
|
+
* used in Authorization Response and Access Token Response.
|
|
46
|
+
*/
|
|
47
|
+
const EXPIRES_IN = "expires_in";
|
|
48
|
+
/**
|
|
49
|
+
* used in Access Token Request and Access Token Response.
|
|
50
|
+
*/
|
|
51
|
+
const REFRESH_TOKEN = "refresh_token";
|
|
52
|
+
/**
|
|
53
|
+
* used in Access Token Request.
|
|
54
|
+
*/
|
|
55
|
+
const USERNAME = "username";
|
|
56
|
+
/**
|
|
57
|
+
* used in Access Token Request.
|
|
58
|
+
*/
|
|
59
|
+
const PASSWORD = "password";
|
|
60
|
+
/**
|
|
61
|
+
* used in Authorization Response and Access Token Response.
|
|
62
|
+
*/
|
|
63
|
+
const ERROR = "error";
|
|
64
|
+
/**
|
|
65
|
+
* used in Authorization Response and Access Token Response.
|
|
66
|
+
*/
|
|
67
|
+
const ERROR_DESCRIPTION = "error_description";
|
|
68
|
+
/**
|
|
69
|
+
* used in Authorization Response and Access Token Response.
|
|
70
|
+
*/
|
|
71
|
+
const ERROR_URI = "error_uri";
|
|
72
|
+
/**
|
|
73
|
+
* Non-standard parameter (used internally).
|
|
74
|
+
*/
|
|
75
|
+
const REGISTRATION_ID = "registration_id";
|
|
76
|
+
}
|
|
77
|
+
export declare namespace PkceParameterNames {
|
|
78
|
+
/**
|
|
79
|
+
* {@code code_challenge} - used in Authorization Request.
|
|
80
|
+
*/
|
|
81
|
+
const CODE_CHALLENGE = "code_challenge";
|
|
82
|
+
/**
|
|
83
|
+
* {@code code_challenge_method} - used in Authorization Request.
|
|
84
|
+
*/
|
|
85
|
+
const CODE_CHALLENGE_METHOD = "code_challenge_method";
|
|
86
|
+
/**
|
|
87
|
+
* {@code code_verifier} - used in Token Request.
|
|
88
|
+
*/
|
|
89
|
+
const CODE_VERIFIER = "code_verifier";
|
|
90
|
+
}
|
|
91
|
+
export interface AuthorizationRequest {
|
|
92
|
+
authorizationUri: string;
|
|
93
|
+
authorizationGrantType: AuthorizationGrantType;
|
|
94
|
+
responseType: AuthorizationResponseType;
|
|
95
|
+
clientId: string;
|
|
96
|
+
redirectUri: string;
|
|
97
|
+
scopes: string[];
|
|
98
|
+
state: string;
|
|
99
|
+
additionalParameters: {
|
|
100
|
+
[key: string]: any;
|
|
101
|
+
};
|
|
102
|
+
authorizationRequestUri: string;
|
|
103
|
+
attributes: {
|
|
104
|
+
[key: string]: any;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export interface AuthorizationResponse {
|
|
108
|
+
redirectUri: string;
|
|
109
|
+
state: string;
|
|
110
|
+
code: string;
|
|
111
|
+
error: OAuth2Error;
|
|
112
|
+
}
|
|
113
|
+
export interface OAuth2Error {
|
|
114
|
+
errorCode: string;
|
|
115
|
+
description?: string;
|
|
116
|
+
uri?: string;
|
|
117
|
+
}
|
|
118
|
+
export interface AuthorizationExchange {
|
|
119
|
+
authorizationRequest: AuthorizationRequest;
|
|
120
|
+
authorizationResponse: AuthorizationResponse;
|
|
121
|
+
}
|
|
122
|
+
export declare class AccessTokenResponse {
|
|
123
|
+
accessToken: AccessToken;
|
|
124
|
+
refreshToken?: RefreshToken;
|
|
125
|
+
additionalParameters: {
|
|
126
|
+
[key: string]: any;
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=endpoint-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-protocol.d.ts","sourceRoot":"","sources":["../../../src/node/endpoint/endpoint-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAErD,yBAAiB,oBAAoB,CAAC;IAClC;;OAEG;IACI,MAAM,UAAU,eAAe,CAAC;IAEvC;;OAEG;IACI,MAAM,aAAa,kBAAkB,CAAC;IAE7C;;OAEG;IACI,MAAM,SAAS,cAAc,CAAC;IAErC;;OAEG;IACI,MAAM,aAAa,kBAAkB,CAAC;IAE7C;;OAEG;IACI,MAAM,YAAY,iBAAiB,CAAC;IAE3C;;OAEG;IACI,MAAM,KAAK,UAAU,CAAC;IAE7B;;OAEG;IACI,MAAM,KAAK,UAAU,CAAC;IAE7B;;OAEG;IACI,MAAM,IAAI,SAAS,CAAC;IAE3B;;OAEG;IACI,MAAM,YAAY,iBAAiB,CAAC;IAE3C;;OAEG;IACI,MAAM,UAAU,eAAe,CAAC;IAEvC;;OAEG;IACI,MAAM,UAAU,eAAe,CAAC;IAEvC;;OAEG;IACI,MAAM,aAAa,kBAAkB,CAAC;IAE7C;;OAEG;IACI,MAAM,QAAQ,aAAa,CAAC;IAEnC;;OAEG;IACI,MAAM,QAAQ,aAAa,CAAC;IAEnC;;OAEG;IACI,MAAM,KAAK,UAAU,CAAC;IAE7B;;OAEG;IACI,MAAM,iBAAiB,sBAAsB,CAAC;IAErD;;OAEG;IACI,MAAM,SAAS,cAAc,CAAC;IAErC;;OAEG;IACI,MAAM,eAAe,oBAAoB,CAAC;CAEpD;AAED,yBAAiB,kBAAkB,CAAC;IAEhC;;OAEG;IACI,MAAM,cAAc,mBAAmB,CAAC;IAE/C;;OAEG;IACI,MAAM,qBAAqB,0BAA0B,CAAC;IAE7D;;OAEG;IACI,MAAM,aAAa,kBAAkB,CAAC;CAChD;AAED,MAAM,WAAW,oBAAoB;IACjC,gBAAgB,EAAE,MAAM,CAAC;IACzB,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,YAAY,EAAE,yBAAyB,CAAC;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;IAC7C,uBAAuB,EAAE,MAAM,CAAC;IAChC,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CACtC;AAED,MAAM,WAAW,qBAAqB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IAClC,oBAAoB,EAAE,oBAAoB,CAAC;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;CAChD;AAED,qBAAa,mBAAmB;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,oBAAoB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,CAAC;CAChD"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccessTokenResponse = exports.PkceParameterNames = exports.OAuth2ParameterNames = void 0;
|
|
4
|
+
var OAuth2ParameterNames;
|
|
5
|
+
(function (OAuth2ParameterNames) {
|
|
6
|
+
/**
|
|
7
|
+
* used in Access Token Request.
|
|
8
|
+
*/
|
|
9
|
+
OAuth2ParameterNames.GRANT_TYPE = 'grant_type';
|
|
10
|
+
/**
|
|
11
|
+
* used in Authorization Request.
|
|
12
|
+
*/
|
|
13
|
+
OAuth2ParameterNames.RESPONSE_TYPE = 'response_type';
|
|
14
|
+
/**
|
|
15
|
+
* used in Authorization Request and Access Token Request.
|
|
16
|
+
*/
|
|
17
|
+
OAuth2ParameterNames.CLIENT_ID = 'client_id';
|
|
18
|
+
/**
|
|
19
|
+
* used in Access Token Request.
|
|
20
|
+
*/
|
|
21
|
+
OAuth2ParameterNames.CLIENT_SECRET = 'client_secret';
|
|
22
|
+
/**
|
|
23
|
+
* used in Authorization Request and Access Token Request.
|
|
24
|
+
*/
|
|
25
|
+
OAuth2ParameterNames.REDIRECT_URI = 'redirect_uri';
|
|
26
|
+
/**
|
|
27
|
+
* used in Authorization Request, Authorization Response, Access Token Request and Access Token Response.
|
|
28
|
+
*/
|
|
29
|
+
OAuth2ParameterNames.SCOPE = 'scope';
|
|
30
|
+
/**
|
|
31
|
+
* used in Authorization Request and Authorization Response.
|
|
32
|
+
*/
|
|
33
|
+
OAuth2ParameterNames.STATE = 'state';
|
|
34
|
+
/**
|
|
35
|
+
* used in Authorization Response and Access Token Request.
|
|
36
|
+
*/
|
|
37
|
+
OAuth2ParameterNames.CODE = 'code';
|
|
38
|
+
/**
|
|
39
|
+
* used in Authorization Response and Access Token Response.
|
|
40
|
+
*/
|
|
41
|
+
OAuth2ParameterNames.ACCESS_TOKEN = 'access_token';
|
|
42
|
+
/**
|
|
43
|
+
* used in Authorization Response and Access Token Response.
|
|
44
|
+
*/
|
|
45
|
+
OAuth2ParameterNames.TOKEN_TYPE = 'token_type';
|
|
46
|
+
/**
|
|
47
|
+
* used in Authorization Response and Access Token Response.
|
|
48
|
+
*/
|
|
49
|
+
OAuth2ParameterNames.EXPIRES_IN = 'expires_in';
|
|
50
|
+
/**
|
|
51
|
+
* used in Access Token Request and Access Token Response.
|
|
52
|
+
*/
|
|
53
|
+
OAuth2ParameterNames.REFRESH_TOKEN = 'refresh_token';
|
|
54
|
+
/**
|
|
55
|
+
* used in Access Token Request.
|
|
56
|
+
*/
|
|
57
|
+
OAuth2ParameterNames.USERNAME = 'username';
|
|
58
|
+
/**
|
|
59
|
+
* used in Access Token Request.
|
|
60
|
+
*/
|
|
61
|
+
OAuth2ParameterNames.PASSWORD = 'password';
|
|
62
|
+
/**
|
|
63
|
+
* used in Authorization Response and Access Token Response.
|
|
64
|
+
*/
|
|
65
|
+
OAuth2ParameterNames.ERROR = 'error';
|
|
66
|
+
/**
|
|
67
|
+
* used in Authorization Response and Access Token Response.
|
|
68
|
+
*/
|
|
69
|
+
OAuth2ParameterNames.ERROR_DESCRIPTION = 'error_description';
|
|
70
|
+
/**
|
|
71
|
+
* used in Authorization Response and Access Token Response.
|
|
72
|
+
*/
|
|
73
|
+
OAuth2ParameterNames.ERROR_URI = 'error_uri';
|
|
74
|
+
/**
|
|
75
|
+
* Non-standard parameter (used internally).
|
|
76
|
+
*/
|
|
77
|
+
OAuth2ParameterNames.REGISTRATION_ID = 'registration_id';
|
|
78
|
+
})(OAuth2ParameterNames = exports.OAuth2ParameterNames || (exports.OAuth2ParameterNames = {}));
|
|
79
|
+
var PkceParameterNames;
|
|
80
|
+
(function (PkceParameterNames) {
|
|
81
|
+
/**
|
|
82
|
+
* {@code code_challenge} - used in Authorization Request.
|
|
83
|
+
*/
|
|
84
|
+
PkceParameterNames.CODE_CHALLENGE = 'code_challenge';
|
|
85
|
+
/**
|
|
86
|
+
* {@code code_challenge_method} - used in Authorization Request.
|
|
87
|
+
*/
|
|
88
|
+
PkceParameterNames.CODE_CHALLENGE_METHOD = 'code_challenge_method';
|
|
89
|
+
/**
|
|
90
|
+
* {@code code_verifier} - used in Token Request.
|
|
91
|
+
*/
|
|
92
|
+
PkceParameterNames.CODE_VERIFIER = 'code_verifier';
|
|
93
|
+
})(PkceParameterNames = exports.PkceParameterNames || (exports.PkceParameterNames = {}));
|
|
94
|
+
class AccessTokenResponse {
|
|
95
|
+
}
|
|
96
|
+
exports.AccessTokenResponse = AccessTokenResponse;
|
|
97
|
+
//# sourceMappingURL=endpoint-protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"endpoint-protocol.js","sourceRoot":"","sources":["../../../src/node/endpoint/endpoint-protocol.ts"],"names":[],"mappings":";;;AAGA,IAAiB,oBAAoB,CA2FpC;AA3FD,WAAiB,oBAAoB;IACjC;;OAEG;IACU,+BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,kCAAa,GAAG,eAAe,CAAC;IAE7C;;OAEG;IACU,8BAAS,GAAG,WAAW,CAAC;IAErC;;OAEG;IACU,kCAAa,GAAG,eAAe,CAAC;IAE7C;;OAEG;IACU,iCAAY,GAAG,cAAc,CAAC;IAE3C;;OAEG;IACU,0BAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,0BAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,yBAAI,GAAG,MAAM,CAAC;IAE3B;;OAEG;IACU,iCAAY,GAAG,cAAc,CAAC;IAE3C;;OAEG;IACU,+BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,+BAAU,GAAG,YAAY,CAAC;IAEvC;;OAEG;IACU,kCAAa,GAAG,eAAe,CAAC;IAE7C;;OAEG;IACU,6BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,6BAAQ,GAAG,UAAU,CAAC;IAEnC;;OAEG;IACU,0BAAK,GAAG,OAAO,CAAC;IAE7B;;OAEG;IACU,sCAAiB,GAAG,mBAAmB,CAAC;IAErD;;OAEG;IACU,8BAAS,GAAG,WAAW,CAAC;IAErC;;OAEG;IACU,oCAAe,GAAG,iBAAiB,CAAC;AAErD,CAAC,EA3FgB,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QA2FpC;AAED,IAAiB,kBAAkB,CAgBlC;AAhBD,WAAiB,kBAAkB;IAE/B;;OAEG;IACU,iCAAc,GAAG,gBAAgB,CAAC;IAE/C;;OAEG;IACU,wCAAqB,GAAG,uBAAuB,CAAC;IAE7D;;OAEG;IACU,gCAAa,GAAG,eAAe,CAAC;AACjD,CAAC,EAhBgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAgBlC;AAiCD,MAAa,mBAAmB;CAI/B;AAJD,kDAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/node/endpoint/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./endpoint-protocol"), exports);
|
|
18
|
+
__exportStar(require("./access-token-response-converter"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/node/endpoint/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,oEAAkD"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export declare enum OAuth2ErrorCodes {
|
|
2
|
+
/**
|
|
3
|
+
* {@code invalid_request} - The request is missing a required parameter,
|
|
4
|
+
* includes an invalid parameter value,
|
|
5
|
+
* includes a parameter more than once, or is otherwise malformed.
|
|
6
|
+
*/
|
|
7
|
+
INVALID_REQUEST = "invalid_request",
|
|
8
|
+
/**
|
|
9
|
+
* {@code unauthorized_client} - The client is not authorized to request
|
|
10
|
+
* an authorization code or access token using this method.
|
|
11
|
+
*/
|
|
12
|
+
UNAUTHORIZED_CLIENT = "unauthorized_client",
|
|
13
|
+
/**
|
|
14
|
+
* {@code access_denied} - The resource owner or authorization server denied the request.
|
|
15
|
+
*/
|
|
16
|
+
ACCESS_DENIED = "access_denied",
|
|
17
|
+
/**
|
|
18
|
+
* {@code unsupported_response_type} - The authorization server does not support
|
|
19
|
+
* obtaining an authorization code or access token using this method.
|
|
20
|
+
*/
|
|
21
|
+
UNSUPPORTED_RESPONSE_TYPE = "unsupported_response_type",
|
|
22
|
+
/**
|
|
23
|
+
* {@code invalid_scope} - The requested scope is invalid, unknown, malformed or
|
|
24
|
+
* exceeds the scope granted by the resource owner.
|
|
25
|
+
*/
|
|
26
|
+
INVALID_SCOPE = "invalid_scope",
|
|
27
|
+
/**
|
|
28
|
+
* {@code insufficient_scope} - The request requires higher privileges than
|
|
29
|
+
* provided by the access token.
|
|
30
|
+
* The resource server SHOULD respond with the HTTP 403 (Forbidden)
|
|
31
|
+
* status code and MAY include the 'scope' attribute with the scope
|
|
32
|
+
* necessary to access the protected resource.
|
|
33
|
+
*
|
|
34
|
+
* @see <a href='https://tools.ietf.org/html/rfc6750#section-3.1'>RFC-6750 - Section 3.1 - Error Codes</a>
|
|
35
|
+
*/
|
|
36
|
+
INSUFFICIENT_SCOPE = "insufficient_scope",
|
|
37
|
+
/**
|
|
38
|
+
* {@code invalid_token} - The access token provided is expired, revoked,
|
|
39
|
+
* malformed, or invalid for other reasons.
|
|
40
|
+
* The resource SHOULD respond with the HTTP 401 (Unauthorized) status code.
|
|
41
|
+
* The client MAY request a new access token and retry the protected resource request.
|
|
42
|
+
*
|
|
43
|
+
* @see <a href='https://tools.ietf.org/html/rfc6750#section-3.1'>RFC-6750 - Section 3.1 - Error Codes</a>
|
|
44
|
+
*/
|
|
45
|
+
INVALID_TOKEN = "invalid_token",
|
|
46
|
+
/**
|
|
47
|
+
* {@code server_error} - The authorization server encountered an
|
|
48
|
+
* unexpected condition that prevented it from fulfilling the request.
|
|
49
|
+
* (This error code is needed because a 500 Internal Server Error HTTP status code
|
|
50
|
+
* cannot be returned to the client via a HTTP redirect.)
|
|
51
|
+
*/
|
|
52
|
+
SERVER_ERROR = "server_error",
|
|
53
|
+
/**
|
|
54
|
+
* {@code temporarily_unavailable} - The authorization server is currently unable
|
|
55
|
+
* to handle the request due to a temporary overloading or maintenance of the server.
|
|
56
|
+
* (This error code is needed because a 503 Service Unavailable HTTP status code
|
|
57
|
+
* cannot be returned to the client via an HTTP redirect.)
|
|
58
|
+
*/
|
|
59
|
+
TEMPORARILY_UNAVAILABLE = "temporarily_unavailable",
|
|
60
|
+
/**
|
|
61
|
+
* {@code invalid_client} - Client authentication failed (e.g., unknown client,
|
|
62
|
+
* no client authentication included, or unsupported authentication method).
|
|
63
|
+
* The authorization server MAY return a HTTP 401 (Unauthorized) status code
|
|
64
|
+
* to indicate which HTTP authentication schemes are supported.
|
|
65
|
+
* If the client attempted to authenticate via the "Authorization" request header field,
|
|
66
|
+
* the authorization server MUST respond with a HTTP 401 (Unauthorized) status code and
|
|
67
|
+
* include the "WWW-Authenticate" response header field matching the authentication scheme used by the client.
|
|
68
|
+
*/
|
|
69
|
+
INVALID_CLIENT = "invalid_client",
|
|
70
|
+
/**
|
|
71
|
+
* {@code invalid_grant} - The provided authorization grant
|
|
72
|
+
* (e.g., authorization code, resource owner credentials) or refresh token is invalid, expired, revoked,
|
|
73
|
+
* does not match the redirection URI used in the authorization request, or was issued to another client.
|
|
74
|
+
*/
|
|
75
|
+
INVALID_GRANT = "invalid_grant",
|
|
76
|
+
/**
|
|
77
|
+
* {@code unsupported_grant_type} - The authorization grant type is not supported by the authorization server.
|
|
78
|
+
*/
|
|
79
|
+
UNSUPPORTED_GRANT_TYPE = "unsupported_grant_type"
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=error-protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-protocol.d.ts","sourceRoot":"","sources":["../../../src/node/error/error-protocol.ts"],"names":[],"mappings":"AAAA,oBAAY,gBAAgB;IAExB;;;;OAIG;IACH,eAAe,oBAAoB;IAEnC;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;OAEG;IACH,aAAa,kBAAkB;IAE/B;;;OAGG;IACH,yBAAyB,8BAA8B;IAEvD;;;OAGG;IACH,aAAa,kBAAkB;IAE/B;;;;;;;;OAQG;IACH,kBAAkB,uBAAuB;IAEzC;;;;;;;OAOG;IACH,aAAa,kBAAkB;IAE/B;;;;;OAKG;IACH,YAAY,iBAAiB;IAE7B;;;;;OAKG;IACH,uBAAuB,4BAA4B;IAEnD;;;;;;;;OAQG;IACH,cAAc,mBAAmB;IAEjC;;;;OAIG;IACH,aAAa,kBAAkB;IAE/B;;OAEG;IACH,sBAAsB,2BAA2B;CAEpD"}
|