@asgardeo/javascript 0.1.20 → 0.1.22
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/dist/AsgardeoJavaScriptClient.d.ts +1 -0
- package/dist/__legacy__/models/client-config.d.ts +1 -1
- package/dist/api/v2/executeEmbeddedSignInFlowV2.d.ts +20 -0
- package/dist/cjs/index.js +293 -70
- package/dist/cjs/index.js.map +4 -4
- package/dist/index.d.ts +4 -0
- package/dist/index.js +288 -70
- package/dist/index.js.map +4 -4
- package/dist/models/client.d.ts +19 -0
- package/dist/models/config.d.ts +7 -0
- package/dist/models/embedded-flow.d.ts +1 -0
- package/dist/models/platforms.d.ts +2 -0
- package/dist/models/v2/embedded-signin-flow-v2.d.ts +78 -0
- package/dist/theme/createTheme.d.ts +1 -17
- package/dist/utils/arrayBufferToBase64url.d.ts +48 -0
- package/dist/utils/base64urlToArrayBuffer.d.ts +55 -0
- package/dist/utils/deriveOrganizationHandleFromBaseUrl.d.ts +3 -3
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export { default as getOrganization, OrganizationDetails, GetOrganizationConfig
|
|
|
31
31
|
export { default as updateOrganization, createPatchOperations, UpdateOrganizationConfig } from './api/updateOrganization';
|
|
32
32
|
export { default as updateMeProfile, UpdateMeProfileConfig } from './api/updateMeProfile';
|
|
33
33
|
export { default as getBrandingPreference, GetBrandingPreferenceConfig } from './api/getBrandingPreference';
|
|
34
|
+
export { default as executeEmbeddedSignInFlowV2 } from './api/v2/executeEmbeddedSignInFlowV2';
|
|
34
35
|
export { default as ApplicationNativeAuthenticationConstants } from './constants/ApplicationNativeAuthenticationConstants';
|
|
35
36
|
export { default as TokenConstants } from './constants/TokenConstants';
|
|
36
37
|
export { default as OIDCRequestConstants } from './constants/OIDCRequestConstants';
|
|
@@ -42,6 +43,7 @@ export { AsgardeoAuthException } from './errors/exception';
|
|
|
42
43
|
export { AllOrganizationsApiResponse } from './models/organization';
|
|
43
44
|
export { Platform } from './models/platforms';
|
|
44
45
|
export { EmbeddedSignInFlowInitiateResponse, EmbeddedSignInFlowStatus, EmbeddedSignInFlowType, EmbeddedSignInFlowStepType, EmbeddedSignInFlowAuthenticator, EmbeddedSignInFlowLink, EmbeddedSignInFlowHandleRequestPayload, EmbeddedSignInFlowHandleResponse, EmbeddedSignInFlowAuthenticatorParamType, EmbeddedSignInFlowAuthenticatorPromptType, EmbeddedSignInFlowAuthenticatorKnownIdPType, } from './models/embedded-signin-flow';
|
|
46
|
+
export { EmbeddedSignInFlowResponseV2, EmbeddedSignInFlowStatusV2, EmbeddedSignInFlowTypeV2, EmbeddedSignInFlowInitiateRequestV2, EmbeddedSignInFlowRequestV2, } from './models/v2/embedded-signin-flow-v2';
|
|
45
47
|
export { EmbeddedFlowType, EmbeddedFlowStatus, EmbeddedFlowExecuteResponse, EmbeddedFlowResponseType, EmbeddedSignUpFlowData, EmbeddedFlowComponent, EmbeddedFlowComponentType, EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteRequestConfig, } from './models/embedded-flow';
|
|
46
48
|
export { FlowMode } from './models/flow';
|
|
47
49
|
export { AsgardeoClient } from './models/client';
|
|
@@ -62,6 +64,8 @@ export { FieldType } from './models/field';
|
|
|
62
64
|
export { default as AsgardeoJavaScriptClient } from './AsgardeoJavaScriptClient';
|
|
63
65
|
export { default as createTheme, DEFAULT_THEME } from './theme/createTheme';
|
|
64
66
|
export { ThemeColors, ThemeConfig, Theme, ThemeMode, ThemeDetection } from './theme/types';
|
|
67
|
+
export { default as arrayBufferToBase64url } from './utils/arrayBufferToBase64url';
|
|
68
|
+
export { default as base64urlToArrayBuffer } from './utils/base64urlToArrayBuffer';
|
|
65
69
|
export { default as bem } from './utils/bem';
|
|
66
70
|
export { default as formatDate } from './utils/formatDate';
|
|
67
71
|
export { default as processUsername } from './utils/processUsername';
|
package/dist/index.js
CHANGED
|
@@ -1929,6 +1929,17 @@ var initializeEmbeddedSignInFlow = async ({
|
|
|
1929
1929
|
payload,
|
|
1930
1930
|
...requestConfig
|
|
1931
1931
|
}) => {
|
|
1932
|
+
try {
|
|
1933
|
+
new URL(url ?? baseUrl);
|
|
1934
|
+
} catch (error2) {
|
|
1935
|
+
throw new AsgardeoAPIError(
|
|
1936
|
+
`Invalid URL provided. ${error2?.toString()}`,
|
|
1937
|
+
"getSchemas-ValidationError-001",
|
|
1938
|
+
"javascript",
|
|
1939
|
+
400,
|
|
1940
|
+
"The provided `url` or `baseUrl` path does not adhere to the URL schema."
|
|
1941
|
+
);
|
|
1942
|
+
}
|
|
1932
1943
|
if (!payload) {
|
|
1933
1944
|
throw new AsgardeoAPIError(
|
|
1934
1945
|
"Authorization payload is required",
|
|
@@ -1944,27 +1955,40 @@ var initializeEmbeddedSignInFlow = async ({
|
|
|
1944
1955
|
searchParams.append(key, String(value));
|
|
1945
1956
|
}
|
|
1946
1957
|
});
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1958
|
+
try {
|
|
1959
|
+
const response = await fetch(url ?? `${baseUrl}/oauth2/authorize`, {
|
|
1960
|
+
...requestConfig,
|
|
1961
|
+
method: requestConfig.method || "POST",
|
|
1962
|
+
headers: {
|
|
1963
|
+
...requestConfig.headers,
|
|
1964
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
1965
|
+
Accept: "application/json"
|
|
1966
|
+
},
|
|
1967
|
+
body: searchParams.toString()
|
|
1968
|
+
});
|
|
1969
|
+
if (!response.ok) {
|
|
1970
|
+
const errorText = await response.text();
|
|
1971
|
+
throw new AsgardeoAPIError(
|
|
1972
|
+
`Authorization request failed: ${errorText}`,
|
|
1973
|
+
"initializeEmbeddedSignInFlow-ResponseError-001",
|
|
1974
|
+
"javascript",
|
|
1975
|
+
response.status,
|
|
1976
|
+
response.statusText
|
|
1977
|
+
);
|
|
1978
|
+
}
|
|
1979
|
+
return await response.json();
|
|
1980
|
+
} catch (error2) {
|
|
1981
|
+
if (error2 instanceof AsgardeoAPIError) {
|
|
1982
|
+
throw error2;
|
|
1983
|
+
}
|
|
1959
1984
|
throw new AsgardeoAPIError(
|
|
1960
|
-
`
|
|
1961
|
-
"initializeEmbeddedSignInFlow-
|
|
1985
|
+
`Network or parsing error: ${error2 instanceof Error ? error2.message : "Unknown error"}`,
|
|
1986
|
+
"initializeEmbeddedSignInFlow-NetworkError-001",
|
|
1962
1987
|
"javascript",
|
|
1963
|
-
|
|
1964
|
-
|
|
1988
|
+
0,
|
|
1989
|
+
"Network Error"
|
|
1965
1990
|
);
|
|
1966
1991
|
}
|
|
1967
|
-
return await response.json();
|
|
1968
1992
|
};
|
|
1969
1993
|
var initializeEmbeddedSignInFlow_default = initializeEmbeddedSignInFlow;
|
|
1970
1994
|
|
|
@@ -1975,6 +1999,17 @@ var executeEmbeddedSignInFlow = async ({
|
|
|
1975
1999
|
payload,
|
|
1976
2000
|
...requestConfig
|
|
1977
2001
|
}) => {
|
|
2002
|
+
try {
|
|
2003
|
+
new URL(url ?? baseUrl);
|
|
2004
|
+
} catch (error2) {
|
|
2005
|
+
throw new AsgardeoAPIError(
|
|
2006
|
+
`Invalid URL provided. ${error2?.toString()}`,
|
|
2007
|
+
"executeEmbeddedSignInFlow-ValidationError-001",
|
|
2008
|
+
"javascript",
|
|
2009
|
+
400,
|
|
2010
|
+
"The provided `url` or `baseUrl` path does not adhere to the URL schema."
|
|
2011
|
+
);
|
|
2012
|
+
}
|
|
1978
2013
|
if (!payload) {
|
|
1979
2014
|
throw new AsgardeoAPIError(
|
|
1980
2015
|
"Authorization payload is required",
|
|
@@ -1984,32 +2019,46 @@ var executeEmbeddedSignInFlow = async ({
|
|
|
1984
2019
|
"If an authorization payload is not provided, the request cannot be constructed correctly."
|
|
1985
2020
|
);
|
|
1986
2021
|
}
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
2022
|
+
try {
|
|
2023
|
+
const response = await fetch(url ?? `${baseUrl}/oauth2/authn`, {
|
|
2024
|
+
...requestConfig,
|
|
2025
|
+
method: requestConfig.method || "POST",
|
|
2026
|
+
headers: {
|
|
2027
|
+
"Content-Type": "application/json",
|
|
2028
|
+
Accept: "application/json",
|
|
2029
|
+
...requestConfig.headers
|
|
2030
|
+
},
|
|
2031
|
+
body: JSON.stringify(payload)
|
|
2032
|
+
});
|
|
2033
|
+
if (!response.ok) {
|
|
2034
|
+
const errorText = await response.text();
|
|
2035
|
+
throw new AsgardeoAPIError(
|
|
2036
|
+
`Authorization request failed: ${errorText}`,
|
|
2037
|
+
"initializeEmbeddedSignInFlow-ResponseError-001",
|
|
2038
|
+
"javascript",
|
|
2039
|
+
response.status,
|
|
2040
|
+
response.statusText
|
|
2041
|
+
);
|
|
2042
|
+
}
|
|
2043
|
+
return await response.json();
|
|
2044
|
+
} catch (error2) {
|
|
2045
|
+
if (error2 instanceof AsgardeoAPIError) {
|
|
2046
|
+
throw error2;
|
|
2047
|
+
}
|
|
1999
2048
|
throw new AsgardeoAPIError(
|
|
2000
|
-
`
|
|
2001
|
-
"
|
|
2049
|
+
`Network or parsing error: ${error2 instanceof Error ? error2.message : "Unknown error"}`,
|
|
2050
|
+
"executeEmbeddedSignInFlow-NetworkError-001",
|
|
2002
2051
|
"javascript",
|
|
2003
|
-
|
|
2004
|
-
|
|
2052
|
+
0,
|
|
2053
|
+
"Network Error"
|
|
2005
2054
|
);
|
|
2006
2055
|
}
|
|
2007
|
-
return await response.json();
|
|
2008
2056
|
};
|
|
2009
2057
|
var executeEmbeddedSignInFlow_default = executeEmbeddedSignInFlow;
|
|
2010
2058
|
|
|
2011
2059
|
// src/models/embedded-flow.ts
|
|
2012
2060
|
var EmbeddedFlowType = /* @__PURE__ */ ((EmbeddedFlowType2) => {
|
|
2061
|
+
EmbeddedFlowType2["Authentication"] = "AUTHENTICATION";
|
|
2013
2062
|
EmbeddedFlowType2["Registration"] = "REGISTRATION";
|
|
2014
2063
|
return EmbeddedFlowType2;
|
|
2015
2064
|
})(EmbeddedFlowType || {});
|
|
@@ -2052,30 +2101,54 @@ var executeEmbeddedSignUpFlow = async ({
|
|
|
2052
2101
|
"At least one of the baseUrl or url must be provided to execute the embedded sign up flow."
|
|
2053
2102
|
);
|
|
2054
2103
|
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
headers: {
|
|
2059
|
-
"Content-Type": "application/json",
|
|
2060
|
-
Accept: "application/json",
|
|
2061
|
-
...requestConfig.headers
|
|
2062
|
-
},
|
|
2063
|
-
body: JSON.stringify({
|
|
2064
|
-
...payload ?? {},
|
|
2065
|
-
flowType: "REGISTRATION" /* Registration */
|
|
2066
|
-
})
|
|
2067
|
-
});
|
|
2068
|
-
if (!response.ok) {
|
|
2069
|
-
const errorText = await response.text();
|
|
2104
|
+
try {
|
|
2105
|
+
new URL(url ?? baseUrl);
|
|
2106
|
+
} catch (error2) {
|
|
2070
2107
|
throw new AsgardeoAPIError(
|
|
2071
|
-
`
|
|
2072
|
-
"
|
|
2108
|
+
`Invalid URL provided. ${error2?.toString()}`,
|
|
2109
|
+
"executeEmbeddedSignUpFlow-ValidationError-001",
|
|
2073
2110
|
"javascript",
|
|
2074
|
-
|
|
2075
|
-
|
|
2111
|
+
400,
|
|
2112
|
+
"The provided `url` or `baseUrl` path does not adhere to the URL schema."
|
|
2113
|
+
);
|
|
2114
|
+
}
|
|
2115
|
+
try {
|
|
2116
|
+
const response = await fetch(url ?? `${baseUrl}/api/server/v1/flow/execute`, {
|
|
2117
|
+
...requestConfig,
|
|
2118
|
+
method: requestConfig.method || "POST",
|
|
2119
|
+
headers: {
|
|
2120
|
+
"Content-Type": "application/json",
|
|
2121
|
+
Accept: "application/json",
|
|
2122
|
+
...requestConfig.headers
|
|
2123
|
+
},
|
|
2124
|
+
body: JSON.stringify({
|
|
2125
|
+
...payload ?? {},
|
|
2126
|
+
flowType: "REGISTRATION" /* Registration */
|
|
2127
|
+
})
|
|
2128
|
+
});
|
|
2129
|
+
if (!response.ok) {
|
|
2130
|
+
const errorText = await response.text();
|
|
2131
|
+
throw new AsgardeoAPIError(
|
|
2132
|
+
`Embedded SignUp flow execution failed: ${errorText}`,
|
|
2133
|
+
"javascript-executeEmbeddedSignUpFlow-ResponseError-100",
|
|
2134
|
+
"javascript",
|
|
2135
|
+
response.status,
|
|
2136
|
+
response.statusText
|
|
2137
|
+
);
|
|
2138
|
+
}
|
|
2139
|
+
return await response.json();
|
|
2140
|
+
} catch (error2) {
|
|
2141
|
+
if (error2 instanceof AsgardeoAPIError) {
|
|
2142
|
+
throw error2;
|
|
2143
|
+
}
|
|
2144
|
+
throw new AsgardeoAPIError(
|
|
2145
|
+
`Network or parsing error: ${error2 instanceof Error ? error2.message : "Unknown error"}`,
|
|
2146
|
+
"executeEmbeddedSignUpFlow-NetworkError-001",
|
|
2147
|
+
"javascript",
|
|
2148
|
+
0,
|
|
2149
|
+
"Network Error"
|
|
2076
2150
|
);
|
|
2077
2151
|
}
|
|
2078
|
-
return await response.json();
|
|
2079
2152
|
};
|
|
2080
2153
|
var executeEmbeddedSignUpFlow_default = executeEmbeddedSignUpFlow;
|
|
2081
2154
|
|
|
@@ -2092,26 +2165,39 @@ var getUserInfo = async ({ url, ...requestConfig }) => {
|
|
|
2092
2165
|
"Invalid Request"
|
|
2093
2166
|
);
|
|
2094
2167
|
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2168
|
+
try {
|
|
2169
|
+
const response = await fetch(url, {
|
|
2170
|
+
...requestConfig,
|
|
2171
|
+
method: "GET",
|
|
2172
|
+
headers: {
|
|
2173
|
+
"Content-Type": "application/json",
|
|
2174
|
+
Accept: "application/json",
|
|
2175
|
+
...requestConfig.headers
|
|
2176
|
+
}
|
|
2177
|
+
});
|
|
2178
|
+
if (!response.ok) {
|
|
2179
|
+
const errorText = await response.text();
|
|
2180
|
+
throw new AsgardeoAPIError(
|
|
2181
|
+
`Failed to fetch user info: ${errorText}`,
|
|
2182
|
+
"getUserInfo-ResponseError-001",
|
|
2183
|
+
"javascript",
|
|
2184
|
+
response.status,
|
|
2185
|
+
response.statusText
|
|
2186
|
+
);
|
|
2187
|
+
}
|
|
2188
|
+
return await response.json();
|
|
2189
|
+
} catch (error2) {
|
|
2190
|
+
if (error2 instanceof AsgardeoAPIError) {
|
|
2191
|
+
throw error2;
|
|
2102
2192
|
}
|
|
2103
|
-
});
|
|
2104
|
-
if (!response.ok) {
|
|
2105
|
-
const errorText = await response.text();
|
|
2106
2193
|
throw new AsgardeoAPIError(
|
|
2107
|
-
`
|
|
2108
|
-
"getUserInfo-
|
|
2194
|
+
`Network or parsing error: ${error2 instanceof Error ? error2.message : "Unknown error"}`,
|
|
2195
|
+
"getUserInfo-NetworkError-001",
|
|
2109
2196
|
"javascript",
|
|
2110
|
-
|
|
2111
|
-
|
|
2197
|
+
0,
|
|
2198
|
+
"Network Error"
|
|
2112
2199
|
);
|
|
2113
2200
|
}
|
|
2114
|
-
return await response.json();
|
|
2115
2201
|
};
|
|
2116
2202
|
var getUserInfo_default = getUserInfo;
|
|
2117
2203
|
|
|
@@ -2779,6 +2865,102 @@ var getBrandingPreference = async ({
|
|
|
2779
2865
|
};
|
|
2780
2866
|
var getBrandingPreference_default = getBrandingPreference;
|
|
2781
2867
|
|
|
2868
|
+
// src/models/v2/embedded-signin-flow-v2.ts
|
|
2869
|
+
var EmbeddedSignInFlowStatusV2 = /* @__PURE__ */ ((EmbeddedSignInFlowStatusV22) => {
|
|
2870
|
+
EmbeddedSignInFlowStatusV22["Complete"] = "COMPLETE";
|
|
2871
|
+
EmbeddedSignInFlowStatusV22["Incomplete"] = "INCOMPLETE";
|
|
2872
|
+
EmbeddedSignInFlowStatusV22["Error"] = "ERROR";
|
|
2873
|
+
return EmbeddedSignInFlowStatusV22;
|
|
2874
|
+
})(EmbeddedSignInFlowStatusV2 || {});
|
|
2875
|
+
var EmbeddedSignInFlowTypeV2 = /* @__PURE__ */ ((EmbeddedSignInFlowTypeV22) => {
|
|
2876
|
+
EmbeddedSignInFlowTypeV22["Redirection"] = "REDIRECTION";
|
|
2877
|
+
EmbeddedSignInFlowTypeV22["View"] = "VIEW";
|
|
2878
|
+
return EmbeddedSignInFlowTypeV22;
|
|
2879
|
+
})(EmbeddedSignInFlowTypeV2 || {});
|
|
2880
|
+
|
|
2881
|
+
// src/api/v2/executeEmbeddedSignInFlowV2.ts
|
|
2882
|
+
var executeEmbeddedSignInFlowV2 = async ({
|
|
2883
|
+
url,
|
|
2884
|
+
baseUrl,
|
|
2885
|
+
payload,
|
|
2886
|
+
sessionDataKey,
|
|
2887
|
+
...requestConfig
|
|
2888
|
+
}) => {
|
|
2889
|
+
if (!payload) {
|
|
2890
|
+
throw new AsgardeoAPIError(
|
|
2891
|
+
"Authorization payload is required",
|
|
2892
|
+
"executeEmbeddedSignInFlow-ValidationError-002",
|
|
2893
|
+
"javascript",
|
|
2894
|
+
400,
|
|
2895
|
+
"If an authorization payload is not provided, the request cannot be constructed correctly."
|
|
2896
|
+
);
|
|
2897
|
+
}
|
|
2898
|
+
let endpoint = url ?? `${baseUrl}/flow/execute`;
|
|
2899
|
+
const response = await fetch(endpoint, {
|
|
2900
|
+
...requestConfig,
|
|
2901
|
+
method: requestConfig.method || "POST",
|
|
2902
|
+
headers: {
|
|
2903
|
+
"Content-Type": "application/json",
|
|
2904
|
+
Accept: "application/json",
|
|
2905
|
+
...requestConfig.headers
|
|
2906
|
+
},
|
|
2907
|
+
body: JSON.stringify(payload)
|
|
2908
|
+
});
|
|
2909
|
+
if (!response.ok) {
|
|
2910
|
+
const errorText = await response.text();
|
|
2911
|
+
throw new AsgardeoAPIError(
|
|
2912
|
+
`Authorization request failed: ${errorText}`,
|
|
2913
|
+
"executeEmbeddedSignInFlow-ResponseError-001",
|
|
2914
|
+
"javascript",
|
|
2915
|
+
response.status,
|
|
2916
|
+
response.statusText
|
|
2917
|
+
);
|
|
2918
|
+
}
|
|
2919
|
+
const flowResponse = await response.json();
|
|
2920
|
+
if (flowResponse.flowStatus === "COMPLETE" /* Complete */ && flowResponse.assertion && sessionDataKey) {
|
|
2921
|
+
try {
|
|
2922
|
+
const oauth2Response = await fetch(`${baseUrl}/oauth2/authorize`, {
|
|
2923
|
+
method: "POST",
|
|
2924
|
+
headers: {
|
|
2925
|
+
"Content-Type": "application/json",
|
|
2926
|
+
Accept: "application/json",
|
|
2927
|
+
...requestConfig.headers
|
|
2928
|
+
},
|
|
2929
|
+
body: JSON.stringify({
|
|
2930
|
+
assertion: flowResponse.assertion,
|
|
2931
|
+
sessionDataKey
|
|
2932
|
+
}),
|
|
2933
|
+
credentials: "include"
|
|
2934
|
+
});
|
|
2935
|
+
if (!oauth2Response.ok) {
|
|
2936
|
+
const oauth2ErrorText = await oauth2Response.text();
|
|
2937
|
+
throw new AsgardeoAPIError(
|
|
2938
|
+
`OAuth2 authorization failed: ${oauth2ErrorText}`,
|
|
2939
|
+
"executeEmbeddedSignInFlow-OAuth2Error-002",
|
|
2940
|
+
"javascript",
|
|
2941
|
+
oauth2Response.status,
|
|
2942
|
+
oauth2Response.statusText
|
|
2943
|
+
);
|
|
2944
|
+
}
|
|
2945
|
+
const oauth2Result = await oauth2Response.json();
|
|
2946
|
+
return {
|
|
2947
|
+
flowStatus: flowResponse.flowStatus,
|
|
2948
|
+
redirectUrl: oauth2Result.redirect_uri
|
|
2949
|
+
};
|
|
2950
|
+
} catch (authError) {
|
|
2951
|
+
throw new AsgardeoAPIError(
|
|
2952
|
+
`OAuth2 authorization failed: ${authError instanceof Error ? authError.message : "Unknown error"}`,
|
|
2953
|
+
"executeEmbeddedSignInFlow-OAuth2Error-001",
|
|
2954
|
+
"javascript",
|
|
2955
|
+
500,
|
|
2956
|
+
"Failed to complete OAuth2 authorization after successful embedded sign-in flow."
|
|
2957
|
+
);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
return flowResponse;
|
|
2961
|
+
};
|
|
2962
|
+
var executeEmbeddedSignInFlowV2_default = executeEmbeddedSignInFlowV2;
|
|
2963
|
+
|
|
2782
2964
|
// src/constants/ApplicationNativeAuthenticationConstants.ts
|
|
2783
2965
|
var ApplicationNativeAuthenticationConstants = {
|
|
2784
2966
|
SupportedAuthenticators: {
|
|
@@ -2813,6 +2995,7 @@ var VendorConstants_default = VendorConstants;
|
|
|
2813
2995
|
var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
2814
2996
|
Platform2["Asgardeo"] = "ASGARDEO";
|
|
2815
2997
|
Platform2["IdentityServer"] = "IDENTITY_SERVER";
|
|
2998
|
+
Platform2["AsgardeoV2"] = "AsgardeoV2";
|
|
2816
2999
|
Platform2["Unknown"] = "UNKNOWN";
|
|
2817
3000
|
return Platform2;
|
|
2818
3001
|
})(Platform || {});
|
|
@@ -3467,6 +3650,30 @@ var createTheme = (config = {}, isDark = false) => {
|
|
|
3467
3650
|
var DEFAULT_THEME = "light";
|
|
3468
3651
|
var createTheme_default = createTheme;
|
|
3469
3652
|
|
|
3653
|
+
// src/utils/arrayBufferToBase64url.ts
|
|
3654
|
+
var arrayBufferToBase64url = (buffer) => {
|
|
3655
|
+
const bytes = new Uint8Array(buffer);
|
|
3656
|
+
let binary = "";
|
|
3657
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
3658
|
+
binary += String.fromCharCode(bytes[i]);
|
|
3659
|
+
}
|
|
3660
|
+
return btoa(binary).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
|
|
3661
|
+
};
|
|
3662
|
+
var arrayBufferToBase64url_default = arrayBufferToBase64url;
|
|
3663
|
+
|
|
3664
|
+
// src/utils/base64urlToArrayBuffer.ts
|
|
3665
|
+
var base64urlToArrayBuffer = (base64url) => {
|
|
3666
|
+
const padding = "=".repeat((4 - base64url.length % 4) % 4);
|
|
3667
|
+
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/") + padding;
|
|
3668
|
+
const binaryString = atob(base64);
|
|
3669
|
+
const bytes = new Uint8Array(binaryString.length);
|
|
3670
|
+
for (let i = 0; i < binaryString.length; i++) {
|
|
3671
|
+
bytes[i] = binaryString.charCodeAt(i);
|
|
3672
|
+
}
|
|
3673
|
+
return bytes.buffer;
|
|
3674
|
+
};
|
|
3675
|
+
var base64urlToArrayBuffer_default = base64urlToArrayBuffer;
|
|
3676
|
+
|
|
3470
3677
|
// src/utils/bem.ts
|
|
3471
3678
|
var bem = (baseClass, element, modifier) => {
|
|
3472
3679
|
let className = baseClass;
|
|
@@ -3606,6 +3813,12 @@ var BROWSER_STYLES = {
|
|
|
3606
3813
|
prefix: "color: #7c3aed; font-weight: bold;",
|
|
3607
3814
|
timestamp: "color: #6b7280; font-size: 0.9em;"
|
|
3608
3815
|
};
|
|
3816
|
+
var LOG_LEVEL_ORDER = {
|
|
3817
|
+
debug: 0,
|
|
3818
|
+
info: 1,
|
|
3819
|
+
warn: 2,
|
|
3820
|
+
error: 3
|
|
3821
|
+
};
|
|
3609
3822
|
var Logger = class _Logger {
|
|
3610
3823
|
constructor(config = {}) {
|
|
3611
3824
|
__publicField(this, "config");
|
|
@@ -3627,7 +3840,7 @@ var Logger = class _Logger {
|
|
|
3627
3840
|
* Check if a log level should be output
|
|
3628
3841
|
*/
|
|
3629
3842
|
shouldLog(level) {
|
|
3630
|
-
return level >= this.config.level;
|
|
3843
|
+
return LOG_LEVEL_ORDER[level] >= LOG_LEVEL_ORDER[this.config.level];
|
|
3631
3844
|
}
|
|
3632
3845
|
/**
|
|
3633
3846
|
* Get timestamp string
|
|
@@ -4314,8 +4527,10 @@ export {
|
|
|
4314
4527
|
EmbeddedSignInFlowAuthenticatorParamType,
|
|
4315
4528
|
EmbeddedSignInFlowAuthenticatorPromptType,
|
|
4316
4529
|
EmbeddedSignInFlowStatus,
|
|
4530
|
+
EmbeddedSignInFlowStatusV2,
|
|
4317
4531
|
EmbeddedSignInFlowStepType,
|
|
4318
4532
|
EmbeddedSignInFlowType,
|
|
4533
|
+
EmbeddedSignInFlowTypeV2,
|
|
4319
4534
|
FieldType,
|
|
4320
4535
|
FlowMode,
|
|
4321
4536
|
IsomorphicCrypto,
|
|
@@ -4325,6 +4540,8 @@ export {
|
|
|
4325
4540
|
TokenConstants_default as TokenConstants,
|
|
4326
4541
|
VendorConstants_default as VendorConstants,
|
|
4327
4542
|
WellKnownSchemaIds,
|
|
4543
|
+
arrayBufferToBase64url_default as arrayBufferToBase64url,
|
|
4544
|
+
base64urlToArrayBuffer_default as base64urlToArrayBuffer,
|
|
4328
4545
|
bem_default as bem,
|
|
4329
4546
|
configure as configureLogger,
|
|
4330
4547
|
createComponentLogger,
|
|
@@ -4339,6 +4556,7 @@ export {
|
|
|
4339
4556
|
deriveOrganizationHandleFromBaseUrl_default as deriveOrganizationHandleFromBaseUrl,
|
|
4340
4557
|
error,
|
|
4341
4558
|
executeEmbeddedSignInFlow_default as executeEmbeddedSignInFlow,
|
|
4559
|
+
executeEmbeddedSignInFlowV2_default as executeEmbeddedSignInFlowV2,
|
|
4342
4560
|
executeEmbeddedSignUpFlow_default as executeEmbeddedSignUpFlow,
|
|
4343
4561
|
extractPkceStorageKeyFromState_default as extractPkceStorageKeyFromState,
|
|
4344
4562
|
extractUserClaimsFromIdToken_default as extractUserClaimsFromIdToken,
|