I've tried to set up an implicit authorization workflow with JavaScript SDK version 2.0:
<script type='text/javascript' src='https://api.stackexchange.com/js/2.0/all.js'></script>
I was using localhost
with other parameters set up properly. Two bugs related to SE.authenticate
appeared:
1. Users who have not logged in before get stuck at login_success
After the user enters his login/password at https://stackexchange.com/oauth/dialog?...
, he encounters:
Application Login Failure
An error occurred while login into an application.
Error Details
error description: could not parse proxy url
at another https://stackexchange.com/oauth/dialog?...
.
Solution: Clicking on "Run Example With Version" (the one that calls SE.authenticate
) button again. The second time, being logged in, it redirects properly and authorizes the client.
Related:
- JavaScript SDK-based workflow never pushes message back from OAuth login_success page on Stack Exchange side
- Implicit OAuth flow is not working when the user is not logged in.
- OAuth redirect not completing
2. SE.authenticate
ignores the port
I run index.html
with Stack Exchange authentication on localhost:8080
. Bug 1 appears again. But now calling SE.authenticate
second time doesn't work. The process stops on https://stackexchange.com/oauth/login_success?...
page saying Authorizing Application
.
The console says:
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost') does not match the recipient window's origin ('http://localhost:8080').
Solution: Switching back to localhost(:80)
.
Related:
- Javascript SDK channelUrl for local development (solved, not fixed)
Solutions
These solutions don't address the issues directly. The problems will persist until JS SDK is fixed.