This is a guide to implementing social linking within a Turnkey-powered application. For more information on what social linking is, see here.
<Auth/>
component is straightforward.
Simply add the socialLinking
property to your authConfig
object and set it to true
. This will enable social linking for your application.
handleOAuthLogin
function within the Auth
component in the @turnkey/sdk-react GitHub repository.
handleOAuthLogin
function / endpoint that can optionally allow for social linking. Code references are in TypeScript, but you can easily adapt this to your backend language of choice.
oidcToken
: The OIDC token received from the social login provider.providerName
: The name of the social login provider (e.g., “google”, “apple”, etc.).publicKey
: A public key generated by the client.socialLinking
: A boolean indicating whether social linking is enabled. Defaults to false
.email
and issuer
(iss
) from the user’s OIDC token.
oidcToken
, publicKey
, and the determined organizationId
.
handleOAuthLogin
function as well as a helper function to create a sub-organization (can also be implemented inline).