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


#3

For others who may encounter a similar issue, the application is running inside an iframe, since it was running embedded in Zendesk, and so when the Google authentication was trying to load it could not as it cannot be loaded inside an iframe. This results in a blank page. A possible alternative would be to trigger the authentication flow through the means of a popup; this community post may contain useful information on this (Auth0.js Popup Autoclose).

If anyone came here for trying to achieve dynamic redirect after authentication you will find a good explanation on that here: https://community.auth0.com/questions/12111/dynamic-callback-after-login


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.