Let members sign in with an identity provider that you run yourself, such as GitHub. You run the provider's OAuth flow, then sync the result with Wix authentication to log the member in.
Use this approach for a provider Wix doesn't support directly. For Google, Facebook, or a custom OpenID Connect (OIDC) connection, see Sign in with an Identity Provider, where Wix runs the flow instead.
Complete the following steps:
Once the member is logged in, you can redirect them to your home page.
Note: Use this flow only for a provider you run yourself. If Wix can run the provider for you, including Google and Facebook, it's simpler to add a provider button and let Wix run the sign-in.
Make sure you have the following:
Once you have the member’s email address, you can check if any of them are associated with a Wix member ID using the Members API.
Note that creating members without explicit registration is an admin function. Make sure to use a WixClient with an API key that has permission to create members.
Now that you have the Wix member ID, request access and refresh tokens for the member with the getMemberTokensForExternalLogin() function.
Important: Before requesting member tokens, ensure visitor tokens are set on the client. You can either provide active tokens when creating the client or call wixClient.auth.generateVisitorTokens().
Important: Your API key grants admin access to your site. Use it only in backend code that runs on your server. Never include it in frontend code that runs in the browser, where visitors could read it.
Note that getting access and refresh tokens is an admin function. Make sure to use the WixClient with your OAuth app that created this visitor, along with an API key that has permission to create member access tokens, to save the visitor’s activity from before they logged in.
Now all that’s left is to store the tokens for later.
Last updated: 15 July 2026