HTTP 401 error help #67

Closed
sadams3180 opened this Issue Aug 19, 2013 · 7 comments

Comments

Projects
None yet
3 participants

Hi,
I'm trying the following POST rest call in Fitnesse.
|Table:smartrics.rest.fitnesse.fixture.RestFixture|!-https://rally1.rallydev.com/slm/webservice/v2.0-!|
|setHeader|!-Content-Type : text/javascript-!|
|setBody|!-{"ID":{"Notes":" Testing works3"}}-!|
|POST|!-/HierarchicalRequirement/XXXXXXX.js?fetch=Notes,Rank&key=xxxx-xxxxx-xxxx-xxx-xxxx-!||||

Running the same POST call in the REST client plug in (IE Firefox) works just fine. However running the same post in Fitnesse results in the following 401 error(below). Any ideas?

Table:smartrics.rest.fitnesse.fixture.RestFixture | https://rally1.rallydev.com/slm/webservice/v2.0 |
setHeader Content-Type : text/javascript |
setBody {"ID":{"Notes":" Testing works3"}} |
POST | "<a href='https://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/XXXXXXX.jsfetch=Notes,Rank&key=xxxx-xxxxx-xxxx-xxx-xxxx>/HierarchicalRequirement/XXXXXXX.js?fetch=Notes,Rank&key=xxxx-xxxxx-xxxx-xxx-xxxx|401 |WWW-Authenticate : Basic realm="Rally ALM"
Content-Type : text/html;charset=ISO-8859-1
Cache-Control : no-cache,no-store,max-age=0,must-revalidate
Expires : Mon, 19 Aug 2013 18:37:39 GMT
Vary : Accept-Encoding
Content-Encoding : gzip
P3P : CP="NON DSP COR CURa PSAa PSDa OUR NOR BUS PUR COM NAV STA"
Content-Length : 313
Date : Mon, 19 Aug 2013 18:37:39 GMT
Connection : close
Set-Cookie : JSESSIONID=qs-app-071gb4akul8ip6515gnqgzkuqss1.qs-app-07;Path=/;Secure;HttpOnly |
����í�ÁRÂ0��ï<ÅNïeiÑ�1äâà ��Ê�¤aÇÄI�L¶ ooÚò�z�=$�l¾�ÿa¸qr" ©CÚ�b��ù�ÓWgO«ìÙ·L-çûË�2Ðãi�1}3öè�h£B$^½¾oóÅâþ1/2LJlÙ�\�à�ÜÍ
xé��Õ±I¼Õ�­oÁF�ý�@�`�Jk��Ø ÷ÑwA�ÀQh"ðj±ö���¦��ý
�ëªÚVý�Ô/S÷(wÁ×��«�m?£kðLu¤p²�ðTNg¸±�TÐ&yqÕh¢IÖ°��å¬(���óég�BE*úv���IHõç�ô�iMÞ� �V�Ø(çäÎ�©�ë�¼�óe�(pl    L¯ê�ÃàßÔäFݨ�õ�©��CTöÉ9dü�×R�Gë� |"
Is it because the URL is HTTPS based insted of HTTP?

Sorry some of the POST result was cut off. Any idea's?
POST xxxxxxxxxxx://rally1.rallydev.com/slm/webservice/v2.0/HierarchicalRequirement/xxxxxx.js?fetch=Notes,Rank&key=xxxx-xxxxx-xxxx-xxx-xxxx/HierarchicalRequirement/xxxxx.js?fetch=Notes,Rank&key=xxxx-xxxxx-xxxx-xxx-xxxx 401 WWW-Authenticate : Basic realm="Rally ALM"
Content-Type : text/html;charset=ISO-8859-1
Cache-Control : no-cache,no-store,max-age=0,must-revalidate
Expires : Mon, 19 Aug 2013 18:37:39 GMT
Vary : Accept-Encoding
Content-Encoding : gzip
P3P : CP="NON DSP COR CURa PSAa PSDa OUR NOR BUS PUR COM NAV STA"
Content-Length : 313
Date : Mon, 19 Aug 2013 18:37:39 GMT
Connection : close
Set-Cookie : JSESSIONID=qs-app-071gb4akul8ip6515gnqgzkuqss1.qs-app-07;Path=/;Secure;HttpOnly ����í�ÁRÂ0��ï<ÅNïeiÑ�1äâà ��Ê�¤aÇÄI�L¶ ooÚò�z�=$�l¾�ÿa¸qr" ©CÚ�b��ù�ÓWgO«ìÙ·L-çûË�2Ðãi�1}3öè�h£B$^½¾oóÅâþ1/2LJlÙ�\�à�ÜÍ
xé��Õ±I¼Õ�­oÁF�ý�@�`�Jk��Ø ÷ÑwA�ÀQh"ðj±ö���¦��ý
�ëªÚVý�Ô/S÷(wÁ×��«�m?£kðLu¤p²�ðTNg¸±�TÐ&yqÕh¢IÖ°��å¬(���óég�BE*úv���IHõç�ô�iMÞ� �V�Ø(çäÎ�©�ë�¼�óe�(pl    L¯ê�ÃàßÔäFݨ�õ�©��CTöÉ9dü�×R�Gë�

sadams3180 closed this Aug 19, 2013

sadams3180 reopened this Aug 19, 2013

sadams3180 closed this Aug 19, 2013

Owner

smartrics commented Aug 19, 2013

i take it's closed... though the binary data you post in the Set-Cookie look suspicious.

if you have solved, can you please share what the solution was

Hi Frabrizio. I apologize for the confusion. It is not closed. Yeah the odd text is what's displayed on the end of my 401 error (as is). Any idea's of why?

sadams3180 reopened this Aug 19, 2013

Hi Frabrizio,
Just following up with this. Any idea's why i'm encountering this 401 server authentication issue? Any guesses on things I might try?

Owner

smartrics commented Aug 23, 2013

i think it's your server expecting some information back in the cookie - there's no support for cookies in the rest fixture
also the cookie seems encoded in some binary form

Set-Cookie : JSESSIONID=qs-app-071gb4akul8ip6515gnqgzkuqss1.qs-app-07;Path=/;Secure;HttpOnly �í�ÁRÂ0�ï<ÅNïeiÑ1äâà �ʤaÇÄIL¶ ooÚòz�=$�l¾�ÿa¸qr"©CÚb�ù�ÓWgO«ìÙ·L-çûË�2Ðãi�1}3öèh£B$^½¾oóÅâþ1/2LJlÙ�\�àÜÍ
xé�Õ±I¼Õ�­oÁFý�@`Jk�Ø÷ÑwA�ÀQh"ðj±ö��¦��ý
ëªÚVý�Ô/S÷(wÁ×��«�m?£kðLu¤p²�ðTNg¸±TÐ&yqÕh¢IÖ°��å¬(óég�BE*úv��IHõç�ôiMÞ V�Ø(çäÎ�©ë¼óe�(pl L¯ê�ÃàßÔäFݨõ�©��CTöÉ9dü×R�Gë

which is not supported either.

you can try to disable cookies on server side assuming your service can deal with non-authenticated request

Owner

smartrics commented Sep 26, 2014

closing - no response

smartrics closed this Sep 26, 2014

yudii commented Dec 30, 2015

binary data in cookie is due to "Content-Encoding : gzip"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment