automatic login to a website

I have got a 3rd party website, which my customer wants to me to login into in order to download some data periodicaly.
The data is customer specific, and password protected.
I have the username/password, and I have searched for ways to do the login automatically so that I can pull data, but so far with no success.
This is a method that I have tried:

When I look into the login page of the website which I am trying to login to (view source), I don’t see the login form, but if I click on “inspect element” in chrome on the fields of the page it does show that there is a login form hiding in there.
Any suggestions

Here is the website which I need to autologin to: unfortunatlly it’s not in english. The first field is the username, the second field is the password and the button is the login

Taking pomeh’s advice, I was able to find the jQuery code that is being triggerted when the text boxes are being modified. Now I want to run this script manually using element.DomContainer.Eval

(function(n,t){function vi(n){var t=n.length,r=i.type(n);return i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||"function"!==r&&(0===t||"number"==typeof t&&t>0&&t-1 in n)}function ne(n){var t=li[n]={};return i.each(n.match(s)||[],function(n,i){t[i]=!0}),t}function uu(n,r,u,f){if(i.acceptData(n)){var s,h,c=i.expando,a="string"==typeof r,l=n.nodeType,o=l?i.cache:n,e=l?n[c]:n[c]&&c;if(e&&o[e]&&(f||o[e].data)||!a||u!==t)return e||(l?n[c]=e=tt.pop()||i.guid++:e=c),o[e]||(o[e]={},l||(o[e].toJSON=i.noop)),("object"==typeof r||"function"==typeof r)&&
(t=n(this);r=r.not(t),t.removeData(f),r.length||clearTimeout(c)},add:function(t){function s(t,u,e){var s=n(this),,f);o.w=u!==i?u:s.width(),o.h=e!==i?e:s.height(),r.apply(this,arguments)}if(!u[o]&&this[e])return!1;var r;if(n.isFunction(t))return r=t,s;r=t.handler,t.handler=s}}}(jQuery,this)

I am not sure how to activate it and give it the relevant data.

41 thoughts on “automatic login to a website”

  1. If you have the right mix of technical requirements then you want Single-Site-Sign-On (SSSO).

    Not all of my clients have SSL and I don’t want my user name and password on all of their sites. They are however all on the same server. Since my site supports SSL I can log in to my own site securely.

    What you need to do conceptually speaking is log the IP of the administrator account along with the data/time stamp. Then if you visit your client’s website (again, on the same server) from that same IP you can have your scripting language check the file. I require a short time-span (anywhere between 30 seconds to two minutes tops) and the same IP address. You can add additional technical requirements to strengthen security of course though your options will be limited as the domain name will be different. If the IP matches the criteria emulate the user being authenticated (static obviously since you likely won’t/shouldn’t have your administrative account information on their site) and you can be automatically signed in.

  2. Maybe you could do this using a web scraping framework like:

    In any case, I think a client side solutions will bring a lot of problems to do this. Maybe you can login into it using a form tag which points to the page, but you won’t be able to manipulate the page afterwards. Also, you may not be able to use AJAX due to CORS restriction. You could embed the target page as an iframe but you can’t either manipulate the page because of differents domains used (you can do that under certains conditions but it’s hard to achieve this imho). So a server side solutions sounds better to me.


Leave a Comment