You need to sign in to do that
Don't have an account?
LOGIN_ERROR_RESTR_DOMAIN (Web Server Flow)
I have a LWC that allows users to setup our integration from within salesforce, for one of our customers this is no longer working and we are seeing the below error being passed to our redirect url as paramaters
'LOGIN_ERROR_RESTR_DOMAIN'
authorization page must be loaded from initial domain
Log from our endpoint
Request(GET //{our redirectURL}?error=LOGIN_ERROR_RESTR_DOMAIN&error_description=authorization+page+must+be+loaded+from+initial+domainstate={{removed for security}})
LWC code to Open login
if (this.consumerKey && this.consumerSecret && this.codeURL) { //opens salesforce window that will send the authorization code to the endpoint declared as 'redirect_uri' window.open('https://login.salesforce.com/services/oauth2/authorize?' + 'response_type=' + 'code' + '&' + 'client_id=' + this.consumerKey + '&' + 'redirect_uri=' + this.codeURL + '&' + 'state={\"client_secret\":\"' + this.consumerSecret + '\",\"client_id\":\"' + this.consumerKey + '\",\"instance_url\":\"' + response.substring(14, response.length - 1) + '\",\"redirect_uri\":\"' + this.codeURL + '\"}' , '_blank' ); //enabling "Continue" button this.disableCont = false; }
We retrieve the customers URL via the below apex which we use to set the state paramater (seen below) the other vairables are enterd by the user on the LWC display:
@AuraEnabled public static String getInstance() { string url = URL.getSalesforceBaseUrl().toString(); return url; }
We are using the login.salesforce.com to open the page as specified in the Web Server Flow documentation, does this now need to be the customers org url ? e.g. https://{{customer}}.my.salesforce.com
Is anyone else haing this issue?