diff --git a/lib/build/recipe/oauth2client/types.d.ts b/lib/build/recipe/oauth2client/types.d.ts index c7b43e2f3..36b685837 100644 --- a/lib/build/recipe/oauth2client/types.d.ts +++ b/lib/build/recipe/oauth2client/types.d.ts @@ -18,7 +18,7 @@ export declare type UserInfo = { }; export declare type ProviderConfigInput = { clientId: string; - clientSecret: string; + clientSecret?: string; oidcDiscoveryEndpoint: string; }; export declare type ProviderConfigWithOIDCInfo = ProviderConfigInput & { diff --git a/lib/build/recipe/oauth2client/utils.js b/lib/build/recipe/oauth2client/utils.js index cc35b347f..0c5e2f39b 100644 --- a/lib/build/recipe/oauth2client/utils.js +++ b/lib/build/recipe/oauth2client/utils.js @@ -28,9 +28,6 @@ function validateAndNormaliseUserInput(_appInfo, config) { // `Only Supertokens OAuth ClientIds are supported in the OAuth2Client recipe. For any other OAuth Clients use the thirdparty recipe.` // ); // } - if (config.providerConfig.clientSecret === undefined) { - throw new Error("Please pass clientSecret argument in the OAuth2Client providerConfig."); - } if (config.providerConfig.oidcDiscoveryEndpoint === undefined) { throw new Error("Please pass oidcDiscoveryEndpoint argument in the OAuth2Client providerConfig."); } diff --git a/lib/build/recipe/oauth2provider/OAuth2Client.d.ts b/lib/build/recipe/oauth2provider/OAuth2Client.d.ts index cef31eb4a..f61f7c4f8 100644 --- a/lib/build/recipe/oauth2provider/OAuth2Client.d.ts +++ b/lib/build/recipe/oauth2provider/OAuth2Client.d.ts @@ -11,7 +11,7 @@ export declare class OAuth2Client { * The secret will be included in the create request as cleartext, and then * never again. The secret is kept in hashed format and is not recoverable once lost. */ - clientSecret: string; + clientSecret?: string; /** * OAuth 2.0 Client Name * The human-readable name of the client to be presented to the end-user during authorization. diff --git a/lib/build/recipe/oauth2provider/index.js b/lib/build/recipe/oauth2provider/index.js index de80a07d9..3a0d0166c 100644 --- a/lib/build/recipe/oauth2provider/index.js +++ b/lib/build/recipe/oauth2provider/index.js @@ -63,7 +63,6 @@ class Wrapper { userContext: utils_1.getUserContext(userContext), }); } - // TODO: revokeToken static createTokenForClientCredentials(clientId, clientSecret, scope, audience, userContext) { return recipe_1.default.getInstanceOrThrowError().recipeInterfaceImpl.tokenExchange({ body: { diff --git a/lib/build/recipe/oauth2provider/types.d.ts b/lib/build/recipe/oauth2provider/types.d.ts index 32442289a..b57e00a2c 100644 --- a/lib/build/recipe/oauth2provider/types.d.ts +++ b/lib/build/recipe/oauth2provider/types.d.ts @@ -386,7 +386,7 @@ export declare type APIInterface = { }; export declare type OAuth2ClientOptions = { clientId: string; - clientSecret: string; + clientSecret?: string; createdAt: string; updatedAt: string; clientName: string; diff --git a/lib/ts/recipe/oauth2client/types.ts b/lib/ts/recipe/oauth2client/types.ts index 0c40c9bdc..740d00d16 100644 --- a/lib/ts/recipe/oauth2client/types.ts +++ b/lib/ts/recipe/oauth2client/types.ts @@ -27,7 +27,7 @@ export type UserInfo = { export type ProviderConfigInput = { clientId: string; - clientSecret: string; + clientSecret?: string; oidcDiscoveryEndpoint: string; }; diff --git a/lib/ts/recipe/oauth2client/utils.ts b/lib/ts/recipe/oauth2client/utils.ts index 925d67d66..5996c2490 100644 --- a/lib/ts/recipe/oauth2client/utils.ts +++ b/lib/ts/recipe/oauth2client/utils.ts @@ -32,10 +32,6 @@ export function validateAndNormaliseUserInput(_appInfo: NormalisedAppinfo, confi // ); // } - if (config.providerConfig.clientSecret === undefined) { - throw new Error("Please pass clientSecret argument in the OAuth2Client providerConfig."); - } - if (config.providerConfig.oidcDiscoveryEndpoint === undefined) { throw new Error("Please pass oidcDiscoveryEndpoint argument in the OAuth2Client providerConfig."); } diff --git a/lib/ts/recipe/oauth2provider/OAuth2Client.ts b/lib/ts/recipe/oauth2provider/OAuth2Client.ts index aa2e7ccac..7105a9262 100644 --- a/lib/ts/recipe/oauth2provider/OAuth2Client.ts +++ b/lib/ts/recipe/oauth2provider/OAuth2Client.ts @@ -28,7 +28,7 @@ export class OAuth2Client { * The secret will be included in the create request as cleartext, and then * never again. The secret is kept in hashed format and is not recoverable once lost. */ - clientSecret: string; + clientSecret?: string; /** * OAuth 2.0 Client Name diff --git a/lib/ts/recipe/oauth2provider/index.ts b/lib/ts/recipe/oauth2provider/index.ts index 88836efee..6bc70f067 100644 --- a/lib/ts/recipe/oauth2provider/index.ts +++ b/lib/ts/recipe/oauth2provider/index.ts @@ -93,8 +93,6 @@ export default class Wrapper { }); } - // TODO: revokeToken - static createTokenForClientCredentials( clientId: string, clientSecret: string, diff --git a/lib/ts/recipe/oauth2provider/types.ts b/lib/ts/recipe/oauth2provider/types.ts index 36dd1ce6b..accaad4a2 100644 --- a/lib/ts/recipe/oauth2provider/types.ts +++ b/lib/ts/recipe/oauth2provider/types.ts @@ -459,7 +459,7 @@ export type APIInterface = { export type OAuth2ClientOptions = { clientId: string; - clientSecret: string; + clientSecret?: string; createdAt: string; updatedAt: string;