vbscript: error on login
Hi!
I need to try to access RTC through vb script and I also found a site that provides a script: http://www.ibm.com/developerworks/rational/library/rational-team-concert-visual-basic/ But I cannot get it to work. I'm stuck at the login which doesn't seem to work even though I've tried to apply all the corrections that were suggested in the comments. I'd post right there on the site with the article but it doesn't work (I'm getting an error message to try later...) so I'm hoping someone here can help. This is my JazzLogin function: Public Function JazzLogin(url, userid, password) Dim JazzUserid Dim JazzPassword JazzUserid = "j_username=" & userid JazzPassword = "j_password=" & password Set http = CreateObject("MSXML2.ServerXMLHTTP.6.0") ' login to jazz server specified in the parameter section. http.Open "GET", url&"/authenticated/identity", False http.Send http.Open "POST", url&"/authenticated/j_security_check", False http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" http.Send JazzUserid&"&"&JazzPassword Set JazzLogin = http End Function Hope you can help me! Additional info: the url itself works when I use it to access RTC via perl. So I don't have an error somewhere in the url or user credentials |
2 answers
It may be about cookies. Check out the below post.
http://stackoverflow.com/questions/35906564/login-into-website-using-msxml2-xmlhttp-instead-of-internetexplorer-application So using XMLHTTP instead of ServerXMLHTTP should resolve the issue. If you are like me and have to use ServerXMLHTTP in order to ignore SSL certificate errors, then you probably have to go through the painful process of parsing the cookies by yourself. Comments
Ilona Krammer
commented Nov 25 '16, 5:23 a.m.
I've tried to pass on all the cookie information that I got, but I'm not even getting a session cookie or something.
|
I was having the same issue above (a POST or GET on the authentication URL from VBA was dying from 400 errors, even though the exact same code works from Perl/cuRL.)
|
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
So the problem obviously is that I'm getting an answer back when trying to login (so it's not a bad request in itself) but that I'm getting this message:
You have followed a direct link to log in to a Jazz server. This page has been presented to ensure that a malicious website cannot use cleverly crafted content to circumvent security. Please log in if you would like to access the server.
I just don't know what to do about it - and I don't know why it happens with vb script but it worked with perl
Anyone got an idea?
Hi Ilona,
Were you able to solve this problem?
Thank you in advance!
Sorry Dmitry,
I could not solve the problem. But we also postponed this script until this October so we are going to have another look at it. Maybe we can find something out.
If you do, please comment here so I get a notification about it!
Best regards,
Ilona
Hi Ilona,