add window message listener to auth-callback template#129
Open
staxmanade wants to merge 1 commit intocolinskow:masterfrom
Open
add window message listener to auth-callback template#129staxmanade wants to merge 1 commit intocolinskow:masterfrom
staxmanade wants to merge 1 commit intocolinskow:masterfrom
Conversation
Owner
|
@staxmanade thank you very much for this. I have one question: is this a breaking change? In other words, will it work with the existing Javascript libraries or do they need to be updated? |
Author
|
it should be backward compatable. I was really hoping you'd say "silly boy, just change X in config and MAGIC" For front ends to leverage it, they would have to post messages to it (like the example js posted). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
My Hope:
You can tell me there's a better way... but if not...
What is this?
Context/Ramblings: (Copied and modified from superlogin pouchdb slack channel)
Ok, I had everything working nice and neato - but the moment I turned on
httpsit backfired…Using
superloginandsuperlogin-clientto implement in the browser Facebook oauth, it used to work great when my site was on anhttponly connection.The moment I stuck a cloudfront
httpsconfiguration in front of it the following scenario started failing…After completing my OAuth login - the redirection back to my site:
https://mysite.com/auth/facebook/callback/code=...returns this page: https://github.com/colinskow/superlogin/blob/master/templates/oauth/auth-callback.ejs in a popup window.But when that page tries to run it raises the following error:
on this line: https://github.com/colinskow/superlogin/blob/master/templates/oauth/auth-callback.ejs#L15
I found this StackOverlow post which talks about tackling the problem possibly another way: http://stackoverflow.com/questions/18625733/how-do-i-get-around-window-opener-cross-domain-security
I gave it a shot and was able to work-around my issue.
I believe that this code should work as it used to, while also enabling this possible new approach.
Below is the (ugly) client-side code used to request the token:
Using it with superlogin-client