@elliemae/pui-app-sdk 5.3.9 → 5.3.10
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.
|
@@ -25,14 +25,16 @@ __export(auth_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(auth_exports);
|
|
26
26
|
var import_http_client = require("../../communication/http-client/index.js");
|
|
27
27
|
const getToken = async ({
|
|
28
|
+
idpCode,
|
|
28
29
|
clientId,
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
scope,
|
|
31
|
+
redirectUri
|
|
31
32
|
}) => {
|
|
32
33
|
const params = new URLSearchParams();
|
|
33
34
|
params.append("grant_type", "authorization_code");
|
|
34
35
|
params.append("client_id", clientId);
|
|
35
36
|
params.append("redirect_uri", redirectUri);
|
|
37
|
+
params.append("scope", scope);
|
|
36
38
|
params.append("code", idpCode);
|
|
37
39
|
const { data } = await (0, import_http_client.getHTTPClient)().post(
|
|
38
40
|
"/oauth2/v1/token",
|
|
@@ -112,8 +112,9 @@ const authorize = async ({
|
|
|
112
112
|
try {
|
|
113
113
|
const { tokenType, accessToken } = await (0, import_auth.getToken)({
|
|
114
114
|
idpCode,
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
clientId,
|
|
116
|
+
scope,
|
|
117
|
+
redirectUri
|
|
117
118
|
});
|
|
118
119
|
const authorizationToken = `${tokenType} ${accessToken}`;
|
|
119
120
|
(0, import_helper.setAuthorizationHeader)(authorizationToken);
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { getHTTPClient } from "../../communication/http-client/index.js";
|
|
2
2
|
const getToken = async ({
|
|
3
|
+
idpCode,
|
|
3
4
|
clientId,
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
scope,
|
|
6
|
+
redirectUri
|
|
6
7
|
}) => {
|
|
7
8
|
const params = new URLSearchParams();
|
|
8
9
|
params.append("grant_type", "authorization_code");
|
|
9
10
|
params.append("client_id", clientId);
|
|
10
11
|
params.append("redirect_uri", redirectUri);
|
|
12
|
+
params.append("scope", scope);
|
|
11
13
|
params.append("code", idpCode);
|
|
12
14
|
const { data } = await getHTTPClient().post(
|
|
13
15
|
"/oauth2/v1/token",
|
|
@@ -88,8 +88,9 @@ const authorize = async ({
|
|
|
88
88
|
try {
|
|
89
89
|
const { tokenType, accessToken } = await getToken({
|
|
90
90
|
idpCode,
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
clientId,
|
|
92
|
+
scope,
|
|
93
|
+
redirectUri
|
|
93
94
|
});
|
|
94
95
|
const authorizationToken = `${tokenType} ${accessToken}`;
|
|
95
96
|
setAuthorizationHeader(authorizationToken);
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { AxiosResponse, AxiosError } from 'axios';
|
|
2
2
|
interface GetTokenRequestParams {
|
|
3
|
+
idpCode: string;
|
|
3
4
|
clientId: string;
|
|
5
|
+
scope: string;
|
|
4
6
|
redirectUri: string;
|
|
5
|
-
idpCode: string;
|
|
6
7
|
}
|
|
7
8
|
export interface GetTokenResponse {
|
|
8
9
|
token_type: string;
|
|
@@ -14,7 +15,7 @@ interface GetTokenError {
|
|
|
14
15
|
export interface GetTokenErrorResponse extends AxiosError {
|
|
15
16
|
response: AxiosResponse<GetTokenError>;
|
|
16
17
|
}
|
|
17
|
-
export declare const getToken: ({ clientId,
|
|
18
|
+
export declare const getToken: ({ idpCode, clientId, scope, redirectUri, }: GetTokenRequestParams) => Promise<{
|
|
18
19
|
tokenType: string;
|
|
19
20
|
accessToken: string;
|
|
20
21
|
}>;
|