Hi folks,
I'm experimenting with the OAuth2 library and have reached the point where I'm getting an authorisation dialogue from the server without any error messages but it's blank.
I think I may be missing some required parameters but, I haven't used libraries much and can't see how to access the URL being built, so I can validate this against the sample code provided by the service provider.
Any clues greatly appreciated.
Thanks
Keith
OAuth2 Library - how to debug a script?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: OAuth2 Library - how to debug a script?
Hi Keith
Following up this discussion from the ‘use’ group, it is not recommended to use localhost as a redirect. What I tend to do is set up a blank php or jsp on my website and use that as the redirectURL. This url is used to send the token to in a browser request. If the page fails or does not exist then that token is never received. The guide on Salesforce site (the one you linked to) says:
Salesforce appends access token information to the redirect URL with the following values:
And will look like this:
https://www.mysite.com/user_callback.js ... te=mystate
I hope this helps
Following up this discussion from the ‘use’ group, it is not recommended to use localhost as a redirect. What I tend to do is set up a blank php or jsp on my website and use that as the redirectURL. This url is used to send the token to in a browser request. If the page fails or does not exist then that token is never received. The guide on Salesforce site (the one you linked to) says:
Salesforce appends access token information to the redirect URL with the following values:
And will look like this:
https://www.mysite.com/user_callback.js ... te=mystate
I hope this helps
Re: OAuth2 Library - how to debug a script?
Hi Sean,
Thanks for responding.
I'm using localhost for initial testing as that is stated as required in the docs and I'm trying to stick as close to the example provided. However, as things are failing long before the return of the token, I think that the return URL is a red herring - for now, at least.
My reading of the Salesforce flow is that the first step is for the OAuth library to open a locked down web browser instance into which the Salesforce authorisation page is displayed to capture login details.
This is being opened but it's blank in LC - and the same parameters open the authorisation page fine in Postman's mechanism to get a token.
So, it looks to me like a library issue. I guess I'll have to roll my own mechanism by attempting to wrap a web viewer instance.
Best,
Keith
Thanks for responding.
I'm using localhost for initial testing as that is stated as required in the docs and I'm trying to stick as close to the example provided. However, as things are failing long before the return of the token, I think that the return URL is a red herring - for now, at least.
My reading of the Salesforce flow is that the first step is for the OAuth library to open a locked down web browser instance into which the Salesforce authorisation page is displayed to capture login details.
This is being opened but it's blank in LC - and the same parameters open the authorisation page fine in Postman's mechanism to get a token.
So, it looks to me like a library issue. I guess I'll have to roll my own mechanism by attempting to wrap a web viewer instance.
Best,
Keith