Auth0 Home Blog Docs

jQuery Login not working in Zendesk App

auth0

#1

I am integrating Auth0 in my zendesk application. When I try login using jQuery Login the redirect URL part is not working.

var AUTH0_DOMAIN = '{DOMAIN}',
AUTH0_CLIENT_ID = '{CLIENTID}',
AUTH0_CALLBACK_URL = window.location.origin;

  var webAuth = new auth0.WebAuth({
    domain: AUTH0_DOMAIN,
    clientID: AUTH0_CLIENT_ID,
    redirectUri: AUTH0_CALLBACK_URL,
    audience: 'https://' + AUTH0_DOMAIN + '/userinfo',
    responseType: 'token id_token',
    scope: 'openid'
  });

on clicking login button it displays the error message “http://localhost:4567/index.html?origin=https%3A%2F%2Fd3v-abc.zendesk.com&app_guid=8caebwef-e095-4fdc-9725-863d6f31542f” is not in the list of allowed callback URLs.

even though I have added http://localhost:4567/… in Allowed Callback URLs in “Auth0 Management API (Test Application)” settings. This work fine in web application.

How to make allowed callback URLs Dynamic, or is there other way to integrate Auth0 in Zendesk application without redirect url .

Thanks in advance.
Regards,
Kab