OAuth Authentication
Social login authentication allows you to log in and sign up users using an OAuth provider, such as Google Sign-In or Facebook Login. You can also configure custom providers through Auth0.
To set up configurations to enable social login, see the Signer Quickstart to enable a social policy in the dashboard.
Authenticate a user
import { import signersigner } from "./signer";
await import signersigner.anyauthenticate({
type: stringtype: "oauth",
authProviderId: stringauthProviderId: "google", // Choose between the auth providers you selected to support from your auth policy
mode: stringmode: "redirect", // Alternatively, you can choose "popup" mode
redirectUrl: stringredirectUrl: "/", // After logging in, redirect to the index page
});
import { class AlchemyWebSignerA SmartAccountSigner that can be used with any SmartContractAccount
AlchemyWebSigner } from "@account-kit/signer";
export const const signer: AlchemyWebSignersigner = new new AlchemyWebSigner(params: AlchemySignerParams): AlchemyWebSignerInitializes an instance with the provided Alchemy signer parameters after parsing them with a schema.
AlchemyWebSigner({
client: ({
connection: {
apiKey: string;
rpcUrl?: undefined;
jwt?: undefined;
} | {
jwt: string;
rpcUrl?: undefined;
apiKey?: undefined;
} | {
rpcUrl: string;
apiKey?: undefined;
jwt?: undefined;
} | {
rpcUrl: string;
jwt: string;
apiKey?: undefined;
};
... 4 more ...;
enablePopupOauth?: boolean | undefined;
} | AlchemySignerWebClient) & (AlchemySignerWebClient | ... 1 more ... | undefined)client: {
connection: {
apiKey: string;
}connection: {
apiKey: stringapiKey: "API_KEY",
},
iframeConfig: {
iframeContainerId: string;
}iframeConfig: {
iframeContainerId: stringiframeContainerId: "alchemy-signer-iframe-container",
},
},
});