# Wix OAuth installer redirect to "undefined" instead of my redirect URL

**URL:** <https://forum.wixstudio.com/t/wix-oauth-installer-redirect-to-undefined-instead-of-my-redirect-url/68451>\
**Category:** Ask the community\
**Tags:** wix-auth, question, code, wix-apps-market\
**Created:** [February 7, 2025, 1:26pm UTC](https://forum.wixstudio.com/t/wix-oauth-installer-redirect-to-undefined-instead-of-my-redirect-url/68451 "2025-02-07T13:26:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5005](https://avatars.discourse-cdn.com/v4/letter/u/a88e4f/32.png) [@user5005](https://forum.wixstudio.com/u/user5005)\
**Post date:** [February 7, 2025, 1:26pm UTC](https://forum.wixstudio.com/t/wix-oauth-installer-redirect-to-undefined-instead-of-my-redirect-url/68451/1 "2025-02-07T13:26:57Z")

</div>

Why does my Wix OAuth installer redirect to “undefined” instead of my redirect URL?

I’m building an external application, that needs access to the contacts from a Wix site. To do so, I must obtain an access token and refresh token to use the Wix Contacts REST API.

Following the custom-authentication-legacy documentation, I created an app in the Wix Developer Console. I configured both the **AppUrl** and the **RedirectURL** to be my external app domain, and I obtained the _appId_ and _appSecret_.

In my external application, I implemented the OAuth flow as follows:

**Step 1** : When a user clicks on “Activate Wix,” my external app redirects them to [https://www.wix.com/installer/install](https://www.wix.com/installer/install) with the following query parameters:

**appId** (set to my Wix app ID)  
**state** (some state token, e.g., our internal id\_token)  
**redirectUrl** (set to my external app domain)

On Wix’s side, the user is then prompted to choose a Wix site to install the app and to accept the permissions.

**Step 2** : According to the docs, after the user consents, they should be redirected back to my external domain with a query param: **code** =\<AUTH\_CODE\>.

However, instead of that, I’m getting redirected to a URL like: [https://www.wix.com/installer/undefined](https://www.wix.com/installer/undefined) which results in a 404 error.

I’ve verified that the parameters I send match the documentation. My expectation is that after a successful installation, Wix would redirect to my provided redirectUrl with an authorization code. Instead, I get a redirect to “undefined.”

Questions:

What could be causing Wix to generate a URL with “undefined” in place of the expected redirect URL? Is there any additional parameter or configuration needed on the Wix Developer Console for this flow to work correctly? Are there known issues with the custom-authentication-legacy flow that might lead to this behavior? Any help or guidance to debug this OAuth flow would be appreciated!
