0

I'm trying to set up a chrome extension to talk to salesforce. I've set up a connected app with a callback url of 'chrome-extension://jifheclheidfillfkjkgngocmbiaollm/options.html'

I'm using the javascript code:

var scopes = ['api'];
        //User Agent Flow
        var url = 'https://login.salesforce.com/services/oauth2/authorize?response_type=code'
                +'&client_id='
                    +'<Client ID>'
                //only for web server
                +'&immediate=false'
                +'&prompt=login'
                +'&redirect_uri='
                   +encodeURIComponent('chrome-extension://'+chrome.runtime.id+'/options.html')
                +'&scope='
                    +scopes.join('%20')
                +'&display=popup';
        window.location.href = url;

When this code executes, it correctly goes to a salesforce login, lets me log in, and let's me 'authorize' my account and the app. However, once that's done, it redirect's me to a blank chrome windows (url is 'about:blank' in the browser).

I've printed to the console to verify that chrome.runtime.id evaluates to the same id as the one I put in the connected app callback url. I'm at a loss of what to check to try to resolve this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.