Let's say I have an app called ExampleApp, with these details:
Client ID: 12345
Key: ThisIsTheKey123()
OAuth Domain: exampleapp.com
[√] Enable Client Side OAuth flow
[√] Disable Desktop Application OAuth Redirect Uri
I'm using the JavaScript SDK 2.0 to authenticate the user. When this code runs:
SE.authenticate({
"success": function (data) {
console.log(data);
},
"error": function (data) {
console.log(data);
},
"scope": ["private_info"],
"networkUsers": true
});
I get the error message
`redirect_uri` is not under the registered domain for this application
Reading the URL bar tells me that the redirect_uri
is
https://stackexchange.com/oauth/login_success?assisted=12345&protocol=https&proxy=https%3A%2F%2Fexampleapp.com%2Fblank&scope=private_info&state=5
So I set my OAuth Domain to stackexchange.com
and tried again. I was able to authenticate, but then it ended up on this screen:
error description: unexpected domain or proxy url
The proxy URL is the channelUrl
I had supplied in SE.init
! I still don't get any of the console messages from the success and error handlers, which means it hasn't returned anything yet. There is an access_token
and expires
in the URL hash, so it did properly authenticate (any my user count went up by one), but I'm not getting anything back because of the error.
Now what? If my OAuth Domain is stackexchange.com
, then my proxy is not recognized. If it is set to exampleapp.com
where my proxy is recognized, then authentication can't start because the redirect_uri
is not recognized. What do I need to do to fix this?