javascript - Implementing automatic login to 3rd party website -
my node-based web service links external 3rd party site requires username/password have (but not same login ofr our webservice). provide seamless user experience, when user clicks link 3rd party site, automatically log them in username/password, , take them straight external page's dashboard.
at least, pre-populate 3rd party login form information, this post detailing similar situation doesn't make me optimistic.
i not believe 3rd party site supports oauth or existing sso protocols. cannot use iframe. 1 viable option seems using some kind of proxy, or using requests (or tokens?) 3rd party site.
knowing have no control on 3rd party login, high-level options how accomplish end goal? things need wary of when choosing solution?
the short answer cannot accomplish if foreign site uses csrf protection on form, or doesn't allow querystring parameters form inputs.
here's can try:
- try redirecting user https://website.com/login?username=xxx&password=xxx
- if works, you're go. if not, there's not way make work in browser.
inspect source code of login page, , use html input name tag values in querystring redirect. if form has username , password input fields, you'd use 2 names.
now -- please keep in mind you're attempting not idea.
storing user's credentials website huge security risk, , not idea. if site / service doesn't offer sso / oauth, going problem in future.
among other things, here of bad things can happen:
- someone gets hold of domain , captures requests username/password.
- the user's computer has been hijacked or man-in-the-middled such when redirect user website, third party captures username/password info.
- the website changes login form, , end sending credentials place on accident.
- the website logs incoming requests, , has bunch of credentials stored in plain text on web servers (if these logs out, that's bad).
Comments
Post a Comment