@better-auth/core 1.7.0-beta.6 → 1.7.0-beta.7
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/context/global.mjs +1 -1
- package/dist/db/adapter/factory.mjs +1 -1
- package/dist/instrumentation/tracer.mjs +1 -1
- package/dist/oauth2/create-authorization-url.d.mts +3 -1
- package/dist/oauth2/create-authorization-url.mjs +3 -1
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/oauth-provider.d.mts +37 -3
- package/dist/oauth2/refresh-access-token.mjs +15 -1
- package/dist/social-providers/apple.d.mts +2 -0
- package/dist/social-providers/atlassian.d.mts +2 -0
- package/dist/social-providers/cognito.d.mts +2 -0
- package/dist/social-providers/discord.d.mts +2 -0
- package/dist/social-providers/dropbox.d.mts +2 -0
- package/dist/social-providers/facebook.d.mts +2 -0
- package/dist/social-providers/figma.d.mts +2 -0
- package/dist/social-providers/github.d.mts +2 -0
- package/dist/social-providers/gitlab.d.mts +2 -0
- package/dist/social-providers/google.d.mts +2 -0
- package/dist/social-providers/huggingface.d.mts +2 -0
- package/dist/social-providers/index.d.mts +70 -0
- package/dist/social-providers/kakao.d.mts +2 -0
- package/dist/social-providers/kick.d.mts +2 -0
- package/dist/social-providers/line.d.mts +2 -0
- package/dist/social-providers/linear.d.mts +2 -0
- package/dist/social-providers/linkedin.d.mts +2 -0
- package/dist/social-providers/microsoft-entra-id.d.mts +2 -0
- package/dist/social-providers/naver.d.mts +2 -0
- package/dist/social-providers/notion.d.mts +2 -0
- package/dist/social-providers/paybin.d.mts +2 -0
- package/dist/social-providers/paypal.d.mts +2 -0
- package/dist/social-providers/polar.d.mts +2 -0
- package/dist/social-providers/railway.d.mts +2 -0
- package/dist/social-providers/reddit.d.mts +2 -0
- package/dist/social-providers/roblox.d.mts +2 -0
- package/dist/social-providers/salesforce.d.mts +2 -0
- package/dist/social-providers/slack.d.mts +2 -0
- package/dist/social-providers/spotify.d.mts +2 -0
- package/dist/social-providers/tiktok.d.mts +2 -0
- package/dist/social-providers/twitch.d.mts +2 -0
- package/dist/social-providers/twitter.d.mts +2 -0
- package/dist/social-providers/vercel.d.mts +2 -0
- package/dist/social-providers/vk.d.mts +2 -0
- package/dist/social-providers/wechat.d.mts +2 -0
- package/dist/social-providers/zoom.d.mts +2 -0
- package/dist/utils/host.d.mts +1 -1
- package/dist/utils/host.mjs +3 -0
- package/package.json +1 -1
- package/src/oauth2/create-authorization-url.ts +4 -0
- package/src/oauth2/index.ts +1 -0
- package/src/oauth2/oauth-provider.ts +40 -2
- package/src/oauth2/refresh-access-token.ts +27 -3
- package/src/oauth2/verify-id-token.ts +2 -0
- package/src/utils/host.ts +10 -1
package/dist/context/global.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BetterAuthError } from "../../error/index.mjs";
|
|
2
|
-
import { getAuthTables } from "../get-tables.mjs";
|
|
3
2
|
import { getColorDepth } from "../../env/color-depth.mjs";
|
|
4
3
|
import { TTY_COLORS, createLogger } from "../../env/logger.mjs";
|
|
4
|
+
import { getAuthTables } from "../get-tables.mjs";
|
|
5
5
|
import { safeJSONParse } from "../../utils/json.mjs";
|
|
6
6
|
import { initGetDefaultModelName } from "./get-default-model-name.mjs";
|
|
7
7
|
import { initGetDefaultFieldName } from "./get-default-field-name.mjs";
|
|
@@ -2,7 +2,7 @@ import { ATTR_HTTP_RESPONSE_STATUS_CODE } from "./attributes.mjs";
|
|
|
2
2
|
import { getOpenTelemetryAPI } from "./api.mjs";
|
|
3
3
|
//#region src/instrumentation/tracer.ts
|
|
4
4
|
const INSTRUMENTATION_SCOPE = "better-auth";
|
|
5
|
-
const INSTRUMENTATION_VERSION = "1.7.0-beta.
|
|
5
|
+
const INSTRUMENTATION_VERSION = "1.7.0-beta.7";
|
|
6
6
|
/**
|
|
7
7
|
* Better-auth uses `throw ctx.redirect(url)` for flow control (e.g. OAuth
|
|
8
8
|
* callbacks). These are APIErrors with 3xx status codes and should not be
|
|
@@ -7,7 +7,7 @@ import { ProviderOptions } from "./oauth-provider.mjs";
|
|
|
7
7
|
* `additionalParams`. Overriding `state`, PKCE, or `redirect_uri` would
|
|
8
8
|
* break the callback correlation and session pinning guarantees.
|
|
9
9
|
*/
|
|
10
|
-
declare const RESERVED_AUTHORIZATION_PARAMS: readonly ["state", "client_id", "redirect_uri", "response_type", "code_challenge", "code_challenge_method", "scope"];
|
|
10
|
+
declare const RESERVED_AUTHORIZATION_PARAMS: readonly ["state", "client_id", "redirect_uri", "response_type", "code_challenge", "code_challenge_method", "nonce", "scope"];
|
|
11
11
|
declare const RESERVED_AUTHORIZATION_PARAMS_SET: ReadonlySet<string>;
|
|
12
12
|
declare function createAuthorizationURL({
|
|
13
13
|
id,
|
|
@@ -24,6 +24,7 @@ declare function createAuthorizationURL({
|
|
|
24
24
|
responseType,
|
|
25
25
|
display,
|
|
26
26
|
loginHint,
|
|
27
|
+
nonce,
|
|
27
28
|
hd,
|
|
28
29
|
responseMode,
|
|
29
30
|
additionalParams,
|
|
@@ -43,6 +44,7 @@ declare function createAuthorizationURL({
|
|
|
43
44
|
responseType?: string | undefined;
|
|
44
45
|
display?: string | undefined;
|
|
45
46
|
loginHint?: string | undefined;
|
|
47
|
+
nonce?: string | undefined;
|
|
46
48
|
hd?: string | undefined;
|
|
47
49
|
responseMode?: string | undefined;
|
|
48
50
|
additionalParams?: Record<string, string> | undefined;
|
|
@@ -13,10 +13,11 @@ const RESERVED_AUTHORIZATION_PARAMS = [
|
|
|
13
13
|
"response_type",
|
|
14
14
|
"code_challenge",
|
|
15
15
|
"code_challenge_method",
|
|
16
|
+
"nonce",
|
|
16
17
|
"scope"
|
|
17
18
|
];
|
|
18
19
|
const RESERVED_AUTHORIZATION_PARAMS_SET = new Set(RESERVED_AUTHORIZATION_PARAMS);
|
|
19
|
-
async function createAuthorizationURL({ id, options, authorizationEndpoint, state, codeVerifier, scopes, claims, redirectURI, duration, prompt, accessType, responseType, display, loginHint, hd, responseMode, additionalParams, scopeJoiner }) {
|
|
20
|
+
async function createAuthorizationURL({ id, options, authorizationEndpoint, state, codeVerifier, scopes, claims, redirectURI, duration, prompt, accessType, responseType, display, loginHint, nonce, hd, responseMode, additionalParams, scopeJoiner }) {
|
|
20
21
|
options = typeof options === "function" ? await options() : options;
|
|
21
22
|
const url = new URL(options.authorizationEndpoint || authorizationEndpoint);
|
|
22
23
|
url.searchParams.set("response_type", responseType || "code");
|
|
@@ -29,6 +30,7 @@ async function createAuthorizationURL({ id, options, authorizationEndpoint, stat
|
|
|
29
30
|
duration && url.searchParams.set("duration", duration);
|
|
30
31
|
display && url.searchParams.set("display", display);
|
|
31
32
|
loginHint && url.searchParams.set("login_hint", loginHint);
|
|
33
|
+
nonce && url.searchParams.set("nonce", nonce);
|
|
32
34
|
prompt && url.searchParams.set("prompt", prompt);
|
|
33
35
|
hd && url.searchParams.set("hd", hd);
|
|
34
36
|
accessType && url.searchParams.set("access_type", accessType);
|
package/dist/oauth2/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { additionalAuthorizationParamsSchema } from "./authorization-params.mjs";
|
|
2
2
|
import { decodeBasicCredentials, encodeBasicCredentials } from "./basic-credentials.mjs";
|
|
3
3
|
import { CLIENT_ASSERTION_TYPE, ClientAssertionContext, ClientAssertionGetter, ClientAssertionGrantType, PRIVATE_KEY_JWT_SIGNING_ALGORITHMS, PrivateKeyJwtClientAssertionGetterOptions, PrivateKeyJwtSigningAlgorithm, createPrivateKeyJwtClientAssertionGetter, resolveClientAssertionParams, signPrivateKeyJwtClientAssertion } from "./client-assertion.mjs";
|
|
4
|
-
import { AuthorizationURLResult, GrantAuthority, OAuth2Tokens, OAuth2UserInfo, OAuthIdTokenConfig, ProviderGrantAuthority, ProviderOptions, UpstreamProvider } from "./oauth-provider.mjs";
|
|
4
|
+
import { AuthorizationURLResult, GrantAuthority, OAuth2Tokens, OAuth2UserInfo, OAuthIdTokenConfig, OAuthRefreshContext, ProviderGrantAuthority, ProviderOptions, UpstreamProvider } from "./oauth-provider.mjs";
|
|
5
5
|
import { TokenEndpointAuth, TokenEndpointAuthMethod, TokenEndpointSecretAuthentication } from "./token-endpoint-auth.mjs";
|
|
6
6
|
import { clientCredentialsToken, clientCredentialsTokenRequest } from "./client-credentials-token.mjs";
|
|
7
7
|
import { RESERVED_AUTHORIZATION_PARAMS, RESERVED_AUTHORIZATION_PARAMS_SET, createAuthorizationURL } from "./create-authorization-url.mjs";
|
|
@@ -12,4 +12,4 @@ import { applyDefaultAccessTokenExpiry, generateCodeChallenge, getOAuth2Tokens,
|
|
|
12
12
|
import { authorizationCodeRequest, validateAuthorizationCode, validateToken } from "./validate-authorization-code.mjs";
|
|
13
13
|
import { ResourceRequestInput, VerifyAccessTokenOptions, VerifyAccessTokenRequestOptions, getJwks, requestToResourceInput, verifyAccessTokenRequest, verifyBearerToken, verifyJwsAccessToken } from "./verify.mjs";
|
|
14
14
|
import { supportsIdTokenSignIn, verifyProviderIdToken } from "./verify-id-token.mjs";
|
|
15
|
-
export { type AccessTokenAuthorization, type AccessTokenAuthorizationScheme, type AuthorizationURLResult, BEARER_AUTHORIZATION_SCHEME, CLIENT_ASSERTION_TYPE, type ClientAssertionContext, type ClientAssertionGetter, type ClientAssertionGrantType, DPOP_AUTHORIZATION_SCHEME, DPOP_PROOF_TYPE, DPOP_SIGNING_ALGORITHMS, type DpopBindingError, type DpopBindingErrorCode, type DpopProofError, type DpopProofErrorCode, type DpopReplayReservation, type DpopReplayReservations, type DpopReplayStore, type DpopSigningAlgorithm, type EnforceDpopBindingParams, type GrantAuthority, type OAuth2Tokens, type OAuth2UserInfo, type OAuthIdTokenConfig, PRIVATE_KEY_JWT_SIGNING_ALGORITHMS, type PrivateKeyJwtClientAssertionGetterOptions, type PrivateKeyJwtSigningAlgorithm, type ProviderGrantAuthority, type ProviderOptions, RESERVED_AUTHORIZATION_PARAMS, RESERVED_AUTHORIZATION_PARAMS_SET, type ResourceRequestInput, type TokenEndpointAuth, type TokenEndpointAuthMethod, type TokenEndpointSecretAuthentication, type UpstreamProvider, type VerifiedDpopProof, type VerifyAccessTokenOptions, type VerifyAccessTokenRequestOptions, type VerifyDpopProofOptions, additionalAuthorizationParamsSchema, applyDefaultAccessTokenExpiry, authorizationCodeRequest, clientCredentialsToken, clientCredentialsTokenRequest, createAuthorizationURL, createDpopBindingError, createDpopProofError, createDpopReplayStore, createInMemoryDpopReplayStore, createPrivateKeyJwtClientAssertionGetter, decodeBasicCredentials, deriveDpopAth, deriveDpopJkt, encodeBasicCredentials, enforceDpopBinding, generateCodeChallenge, getConfirmationJkt, getDpopJktFromPayload, getJwks, getOAuth2Tokens, getPrimaryClientId, includesGrantedScope, isDpopBindingError, isDpopProofError, normalizeDpopHtu, normalizeScopes, parseAccessTokenAuthorization, parseScopeField, readGrantedScopes, refreshAccessToken, refreshAccessTokenRequest, requestToResourceInput, resolveClientAssertionParams, resolveRequestedScopes, signPrivateKeyJwtClientAssertion, stripAccessTokenAuthorizationScheme, supportsIdTokenSignIn, unionGrantedScopes, validateAuthorizationCode, validateToken, verifyAccessTokenRequest, verifyBearerToken, verifyDpopProof, verifyJwsAccessToken, verifyProviderIdToken };
|
|
15
|
+
export { type AccessTokenAuthorization, type AccessTokenAuthorizationScheme, type AuthorizationURLResult, BEARER_AUTHORIZATION_SCHEME, CLIENT_ASSERTION_TYPE, type ClientAssertionContext, type ClientAssertionGetter, type ClientAssertionGrantType, DPOP_AUTHORIZATION_SCHEME, DPOP_PROOF_TYPE, DPOP_SIGNING_ALGORITHMS, type DpopBindingError, type DpopBindingErrorCode, type DpopProofError, type DpopProofErrorCode, type DpopReplayReservation, type DpopReplayReservations, type DpopReplayStore, type DpopSigningAlgorithm, type EnforceDpopBindingParams, type GrantAuthority, type OAuth2Tokens, type OAuth2UserInfo, type OAuthIdTokenConfig, type OAuthRefreshContext, PRIVATE_KEY_JWT_SIGNING_ALGORITHMS, type PrivateKeyJwtClientAssertionGetterOptions, type PrivateKeyJwtSigningAlgorithm, type ProviderGrantAuthority, type ProviderOptions, RESERVED_AUTHORIZATION_PARAMS, RESERVED_AUTHORIZATION_PARAMS_SET, type ResourceRequestInput, type TokenEndpointAuth, type TokenEndpointAuthMethod, type TokenEndpointSecretAuthentication, type UpstreamProvider, type VerifiedDpopProof, type VerifyAccessTokenOptions, type VerifyAccessTokenRequestOptions, type VerifyDpopProofOptions, additionalAuthorizationParamsSchema, applyDefaultAccessTokenExpiry, authorizationCodeRequest, clientCredentialsToken, clientCredentialsTokenRequest, createAuthorizationURL, createDpopBindingError, createDpopProofError, createDpopReplayStore, createInMemoryDpopReplayStore, createPrivateKeyJwtClientAssertionGetter, decodeBasicCredentials, deriveDpopAth, deriveDpopJkt, encodeBasicCredentials, enforceDpopBinding, generateCodeChallenge, getConfirmationJkt, getDpopJktFromPayload, getJwks, getOAuth2Tokens, getPrimaryClientId, includesGrantedScope, isDpopBindingError, isDpopProofError, normalizeDpopHtu, normalizeScopes, parseAccessTokenAuthorization, parseScopeField, readGrantedScopes, refreshAccessToken, refreshAccessTokenRequest, requestToResourceInput, resolveClientAssertionParams, resolveRequestedScopes, signPrivateKeyJwtClientAssertion, stripAccessTokenAuthorizationScheme, supportsIdTokenSignIn, unionGrantedScopes, validateAuthorizationCode, validateToken, verifyAccessTokenRequest, verifyBearerToken, verifyDpopProof, verifyJwsAccessToken, verifyProviderIdToken };
|
|
@@ -69,6 +69,17 @@ type OAuth2UserInfo = {
|
|
|
69
69
|
image?: string | undefined;
|
|
70
70
|
emailVerified: boolean;
|
|
71
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Request metadata available to provider refresh hooks.
|
|
74
|
+
*
|
|
75
|
+
* The refresh flow may be triggered by endpoints such as `getAccessToken` or
|
|
76
|
+
* `refreshToken`; this context gives provider hooks access to the triggering
|
|
77
|
+
* request without exposing the full endpoint implementation surface.
|
|
78
|
+
*/
|
|
79
|
+
interface OAuthRefreshContext {
|
|
80
|
+
headers?: Headers | undefined;
|
|
81
|
+
request?: Request | undefined;
|
|
82
|
+
}
|
|
72
83
|
/**
|
|
73
84
|
* The result of building a provider authorization URL.
|
|
74
85
|
*
|
|
@@ -128,6 +139,12 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
128
139
|
redirectURI: string;
|
|
129
140
|
display?: string | undefined;
|
|
130
141
|
loginHint?: string | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* OIDC nonce generated by the redirect initiator and persisted in OAuth
|
|
144
|
+
* state. Providers that set `requiresIdTokenNonce` must forward this to
|
|
145
|
+
* the authorization URL as the `nonce` parameter.
|
|
146
|
+
*/
|
|
147
|
+
idTokenNonce?: string | undefined;
|
|
131
148
|
/**
|
|
132
149
|
* Extra query parameters to append to the authorization URL.
|
|
133
150
|
* Providers forward these to the shared `createAuthorizationURL` helper,
|
|
@@ -144,6 +161,12 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
144
161
|
deviceId?: string | undefined;
|
|
145
162
|
}) => Promise<OAuth2Tokens | null>;
|
|
146
163
|
getUserInfo: (token: OAuth2Tokens & {
|
|
164
|
+
/**
|
|
165
|
+
* OIDC nonce recovered from OAuth state. Providers that required an
|
|
166
|
+
* ID-token nonce must pass this to `verifyProviderIdToken` before
|
|
167
|
+
* trusting ID-token claims.
|
|
168
|
+
*/
|
|
169
|
+
expectedIdTokenNonce?: string | undefined;
|
|
147
170
|
/**
|
|
148
171
|
* The user object from the provider
|
|
149
172
|
* This is only available for some providers like Apple
|
|
@@ -160,9 +183,13 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
160
183
|
data: T;
|
|
161
184
|
} | null>;
|
|
162
185
|
/**
|
|
163
|
-
* Custom function to refresh a token
|
|
186
|
+
* Custom function to refresh a token.
|
|
187
|
+
*
|
|
188
|
+
* Receives request metadata from the endpoint that triggered the refresh.
|
|
189
|
+
* Providers that don't need request-scoped data can ignore the second
|
|
190
|
+
* argument.
|
|
164
191
|
*/
|
|
165
|
-
refreshAccessToken?: ((refreshToken: string) => Promise<OAuth2Tokens>) | undefined;
|
|
192
|
+
refreshAccessToken?: ((refreshToken: string, ctx?: OAuthRefreshContext) => Promise<OAuth2Tokens>) | undefined;
|
|
166
193
|
/**
|
|
167
194
|
* Declarative id_token verification config consumed by the shared
|
|
168
195
|
* `verifyProviderIdToken` verifier. Providers set this instead of implementing a boolean
|
|
@@ -175,6 +202,13 @@ interface UpstreamProvider<T extends Record<string, any> = Record<string, any>,
|
|
|
175
202
|
* against this value to prevent authorization server mix-up attacks.
|
|
176
203
|
*/
|
|
177
204
|
issuer?: string | undefined;
|
|
205
|
+
/**
|
|
206
|
+
* Require shared OAuth redirect routes to bind ID-token verification to an
|
|
207
|
+
* authorization request nonce. When true, routes generate `idTokenNonce`,
|
|
208
|
+
* pass it to `createAuthorizationURL`, persist it in state, and provide it
|
|
209
|
+
* back to `getUserInfo` as `expectedIdTokenNonce`.
|
|
210
|
+
*/
|
|
211
|
+
requiresIdTokenNonce?: boolean | undefined;
|
|
178
212
|
/**
|
|
179
213
|
* Disable implicit sign up for new users. When set to true for the provider,
|
|
180
214
|
* sign-in need to be called with with requestSignUp as true to create new users.
|
|
@@ -333,4 +367,4 @@ type ProviderOptions<Profile extends Record<string, any> = any> = {
|
|
|
333
367
|
requireEmailVerification?: boolean | undefined;
|
|
334
368
|
};
|
|
335
369
|
//#endregion
|
|
336
|
-
export { AuthorizationURLResult, GrantAuthority, OAuth2Tokens, OAuth2UserInfo, OAuthIdTokenConfig, ProviderGrantAuthority, ProviderOptions, UpstreamProvider };
|
|
370
|
+
export { AuthorizationURLResult, GrantAuthority, OAuth2Tokens, OAuth2UserInfo, OAuthIdTokenConfig, OAuthRefreshContext, ProviderGrantAuthority, ProviderOptions, UpstreamProvider };
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { applyTokenEndpointAuth } from "./token-endpoint-auth.mjs";
|
|
2
2
|
import { betterFetch } from "@better-fetch/fetch";
|
|
3
3
|
//#region src/oauth2/refresh-access-token.ts
|
|
4
|
+
const BLOCKED_REFRESH_TOKEN_PARAMS_SET = new Set([
|
|
5
|
+
"grant_type",
|
|
6
|
+
"refresh_token",
|
|
7
|
+
"__proto__",
|
|
8
|
+
"constructor",
|
|
9
|
+
"prototype"
|
|
10
|
+
]);
|
|
4
11
|
async function refreshAccessTokenRequest({ refreshToken, options, authentication, tokenEndpointAuth, tokenEndpoint, extraParams, resource }) {
|
|
5
12
|
options = typeof options === "function" ? await options() : options;
|
|
6
13
|
const request = buildRefreshAccessTokenRequest({
|
|
@@ -20,6 +27,13 @@ async function refreshAccessTokenRequest({ refreshToken, options, authentication
|
|
|
20
27
|
});
|
|
21
28
|
return request;
|
|
22
29
|
}
|
|
30
|
+
function applyRefreshExtraParams(body, extraParams) {
|
|
31
|
+
if (!extraParams) return;
|
|
32
|
+
for (const [key, value] of Object.entries(extraParams)) {
|
|
33
|
+
if (BLOCKED_REFRESH_TOKEN_PARAMS_SET.has(key)) continue;
|
|
34
|
+
body.set(key, value);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
23
37
|
function buildRefreshAccessTokenRequest({ refreshToken, options, extraParams, resource }) {
|
|
24
38
|
const body = new URLSearchParams();
|
|
25
39
|
const headers = {
|
|
@@ -30,7 +44,7 @@ function buildRefreshAccessTokenRequest({ refreshToken, options, extraParams, re
|
|
|
30
44
|
body.set("refresh_token", refreshToken);
|
|
31
45
|
if (resource) if (typeof resource === "string") body.append("resource", resource);
|
|
32
46
|
else for (const _resource of resource) body.append("resource", _resource);
|
|
33
|
-
if (extraParams)
|
|
47
|
+
if (extraParams) applyRefreshExtraParams(body, extraParams);
|
|
34
48
|
return {
|
|
35
49
|
body,
|
|
36
50
|
headers
|
|
@@ -82,6 +82,7 @@ declare const apple: (options: AppleOptions) => {
|
|
|
82
82
|
redirectURI: string;
|
|
83
83
|
display?: string | undefined;
|
|
84
84
|
loginHint?: string | undefined;
|
|
85
|
+
idTokenNonce?: string | undefined;
|
|
85
86
|
additionalParams?: Record<string, string> | undefined;
|
|
86
87
|
}): Promise<{
|
|
87
88
|
url: URL;
|
|
@@ -106,6 +107,7 @@ declare const apple: (options: AppleOptions) => {
|
|
|
106
107
|
};
|
|
107
108
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
108
109
|
getUserInfo(token: OAuth2Tokens & {
|
|
110
|
+
expectedIdTokenNonce?: string | undefined;
|
|
109
111
|
user?: {
|
|
110
112
|
name?: {
|
|
111
113
|
firstName?: string;
|
|
@@ -35,6 +35,7 @@ declare const atlassian: (options: AtlassianOptions) => {
|
|
|
35
35
|
redirectURI: string;
|
|
36
36
|
display?: string | undefined;
|
|
37
37
|
loginHint?: string | undefined;
|
|
38
|
+
idTokenNonce?: string | undefined;
|
|
38
39
|
additionalParams?: Record<string, string> | undefined;
|
|
39
40
|
}): Promise<{
|
|
40
41
|
url: URL;
|
|
@@ -52,6 +53,7 @@ declare const atlassian: (options: AtlassianOptions) => {
|
|
|
52
53
|
}) => Promise<OAuth2Tokens>;
|
|
53
54
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
54
55
|
getUserInfo(token: OAuth2Tokens & {
|
|
56
|
+
expectedIdTokenNonce?: string | undefined;
|
|
55
57
|
user?: {
|
|
56
58
|
name?: {
|
|
57
59
|
firstName?: string;
|
|
@@ -63,6 +63,7 @@ declare const cognito: (options: CognitoOptions) => {
|
|
|
63
63
|
redirectURI: string;
|
|
64
64
|
display?: string | undefined;
|
|
65
65
|
loginHint?: string | undefined;
|
|
66
|
+
idTokenNonce?: string | undefined;
|
|
66
67
|
additionalParams?: Record<string, string> | undefined;
|
|
67
68
|
}): Promise<{
|
|
68
69
|
url: URL;
|
|
@@ -86,6 +87,7 @@ declare const cognito: (options: CognitoOptions) => {
|
|
|
86
87
|
maxTokenAge: string;
|
|
87
88
|
};
|
|
88
89
|
getUserInfo(token: OAuth2Tokens & {
|
|
90
|
+
expectedIdTokenNonce?: string | undefined;
|
|
89
91
|
user?: {
|
|
90
92
|
name?: {
|
|
91
93
|
firstName?: string;
|
|
@@ -90,6 +90,7 @@ declare const discord: (options: DiscordOptions) => {
|
|
|
90
90
|
redirectURI: string;
|
|
91
91
|
display?: string | undefined;
|
|
92
92
|
loginHint?: string | undefined;
|
|
93
|
+
idTokenNonce?: string | undefined;
|
|
93
94
|
additionalParams?: Record<string, string> | undefined;
|
|
94
95
|
}): Promise<{
|
|
95
96
|
url: URL;
|
|
@@ -106,6 +107,7 @@ declare const discord: (options: DiscordOptions) => {
|
|
|
106
107
|
}) => Promise<OAuth2Tokens>;
|
|
107
108
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
108
109
|
getUserInfo(token: OAuth2Tokens & {
|
|
110
|
+
expectedIdTokenNonce?: string | undefined;
|
|
109
111
|
user?: {
|
|
110
112
|
name?: {
|
|
111
113
|
firstName?: string;
|
|
@@ -34,6 +34,7 @@ declare const dropbox: (options: DropboxOptions) => {
|
|
|
34
34
|
redirectURI: string;
|
|
35
35
|
display?: string | undefined;
|
|
36
36
|
loginHint?: string | undefined;
|
|
37
|
+
idTokenNonce?: string | undefined;
|
|
37
38
|
additionalParams?: Record<string, string> | undefined;
|
|
38
39
|
}) => Promise<{
|
|
39
40
|
url: URL;
|
|
@@ -51,6 +52,7 @@ declare const dropbox: (options: DropboxOptions) => {
|
|
|
51
52
|
}) => Promise<OAuth2Tokens>;
|
|
52
53
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
53
54
|
getUserInfo(token: OAuth2Tokens & {
|
|
55
|
+
expectedIdTokenNonce?: string | undefined;
|
|
54
56
|
user?: {
|
|
55
57
|
name?: {
|
|
56
58
|
firstName?: string;
|
|
@@ -46,6 +46,7 @@ declare const facebook: (options: FacebookOptions) => {
|
|
|
46
46
|
redirectURI: string;
|
|
47
47
|
display?: string | undefined;
|
|
48
48
|
loginHint?: string | undefined;
|
|
49
|
+
idTokenNonce?: string | undefined;
|
|
49
50
|
additionalParams?: Record<string, string> | undefined;
|
|
50
51
|
}): Promise<{
|
|
51
52
|
url: URL;
|
|
@@ -76,6 +77,7 @@ declare const facebook: (options: FacebookOptions) => {
|
|
|
76
77
|
};
|
|
77
78
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
78
79
|
getUserInfo(token: OAuth2Tokens & {
|
|
80
|
+
expectedIdTokenNonce?: string | undefined;
|
|
79
81
|
user?: {
|
|
80
82
|
name?: {
|
|
81
83
|
firstName?: string;
|
|
@@ -26,6 +26,7 @@ declare const figma: (options: FigmaOptions) => {
|
|
|
26
26
|
redirectURI: string;
|
|
27
27
|
display?: string | undefined;
|
|
28
28
|
loginHint?: string | undefined;
|
|
29
|
+
idTokenNonce?: string | undefined;
|
|
29
30
|
additionalParams?: Record<string, string> | undefined;
|
|
30
31
|
}): Promise<{
|
|
31
32
|
url: URL;
|
|
@@ -43,6 +44,7 @@ declare const figma: (options: FigmaOptions) => {
|
|
|
43
44
|
}) => Promise<OAuth2Tokens>;
|
|
44
45
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
45
46
|
getUserInfo(token: OAuth2Tokens & {
|
|
47
|
+
expectedIdTokenNonce?: string | undefined;
|
|
46
48
|
user?: {
|
|
47
49
|
name?: {
|
|
48
50
|
firstName?: string;
|
|
@@ -67,6 +67,7 @@ declare const github: (options: GithubOptions) => {
|
|
|
67
67
|
redirectURI: string;
|
|
68
68
|
display?: string | undefined;
|
|
69
69
|
loginHint?: string | undefined;
|
|
70
|
+
idTokenNonce?: string | undefined;
|
|
70
71
|
additionalParams?: Record<string, string> | undefined;
|
|
71
72
|
}): Promise<{
|
|
72
73
|
url: URL;
|
|
@@ -84,6 +85,7 @@ declare const github: (options: GithubOptions) => {
|
|
|
84
85
|
}) => Promise<OAuth2Tokens | null>;
|
|
85
86
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
86
87
|
getUserInfo(token: OAuth2Tokens & {
|
|
88
|
+
expectedIdTokenNonce?: string | undefined;
|
|
87
89
|
user?: {
|
|
88
90
|
name?: {
|
|
89
91
|
firstName?: string;
|
|
@@ -67,6 +67,7 @@ declare const gitlab: (options: GitlabOptions) => {
|
|
|
67
67
|
redirectURI: string;
|
|
68
68
|
display?: string | undefined;
|
|
69
69
|
loginHint?: string | undefined;
|
|
70
|
+
idTokenNonce?: string | undefined;
|
|
70
71
|
additionalParams?: Record<string, string> | undefined;
|
|
71
72
|
}) => Promise<{
|
|
72
73
|
url: URL;
|
|
@@ -84,6 +85,7 @@ declare const gitlab: (options: GitlabOptions) => {
|
|
|
84
85
|
}) => Promise<OAuth2Tokens>;
|
|
85
86
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
86
87
|
getUserInfo(token: OAuth2Tokens & {
|
|
88
|
+
expectedIdTokenNonce?: string | undefined;
|
|
87
89
|
user?: {
|
|
88
90
|
name?: {
|
|
89
91
|
firstName?: string;
|
|
@@ -76,6 +76,7 @@ declare const google: (options: GoogleOptions) => {
|
|
|
76
76
|
redirectURI: string;
|
|
77
77
|
display?: string | undefined;
|
|
78
78
|
loginHint?: string | undefined;
|
|
79
|
+
idTokenNonce?: string | undefined;
|
|
79
80
|
additionalParams?: Record<string, string> | undefined;
|
|
80
81
|
}): Promise<{
|
|
81
82
|
url: URL;
|
|
@@ -100,6 +101,7 @@ declare const google: (options: GoogleOptions) => {
|
|
|
100
101
|
verifyClaims: ((claims: Record<string, unknown>) => boolean) | undefined;
|
|
101
102
|
};
|
|
102
103
|
getUserInfo(token: OAuth2Tokens & {
|
|
104
|
+
expectedIdTokenNonce?: string | undefined;
|
|
103
105
|
user?: {
|
|
104
106
|
name?: {
|
|
105
107
|
firstName?: string;
|
|
@@ -48,6 +48,7 @@ declare const huggingface: (options: HuggingFaceOptions) => {
|
|
|
48
48
|
redirectURI: string;
|
|
49
49
|
display?: string | undefined;
|
|
50
50
|
loginHint?: string | undefined;
|
|
51
|
+
idTokenNonce?: string | undefined;
|
|
51
52
|
additionalParams?: Record<string, string> | undefined;
|
|
52
53
|
}): Promise<{
|
|
53
54
|
url: URL;
|
|
@@ -65,6 +66,7 @@ declare const huggingface: (options: HuggingFaceOptions) => {
|
|
|
65
66
|
}) => Promise<OAuth2Tokens>;
|
|
66
67
|
refreshAccessToken: (refreshToken: string) => Promise<OAuth2Tokens>;
|
|
67
68
|
getUserInfo(token: OAuth2Tokens & {
|
|
69
|
+
expectedIdTokenNonce?: string | undefined;
|
|
68
70
|
user?: {
|
|
69
71
|
name?: {
|
|
70
72
|
firstName?: string;
|