I am making a simple web app and the service provider I am using authenticates through the OAuth 1.0 protocol. I would like to know how to extract a param after user signs in from a separate browser window and grants access. I have done this before in Objective-C for an iOS app using an event, but am unaware how to do it using a browser and using JavaScript. I assume I do something similar using an addEventListener()
or onClick()
type method? Also, can this quickly be achieved using a JQuery method? Details below.
I want to:
Open a separate window to allow the user to sign in.
User will then 'GRANT' access, at that point, the page will reload with the newly appended parameters to the URL.
I then need to extract the params, which are the verifier and token
oauth_verifier=verifier&oauth_token=token
, from the URL after user signs in.
Something to note:
The service provider does not allow a callback. The user need to pass oauth_callback=oob
for the param.
The link below is what I come across often while searching for an answer, however it just describes how to open a new window and point the user to a URL:
How to open a new window and insert html into it using jQuery?
Thank you for your help!