It's all about the answers!

Ask a question

user authentication in rest api2.0


Julia Ballos (1835) | asked Oct 01 '09, 3:10 a.m.
Hi,

in this article https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2 there are examples for basic and form based authentication using curl. Is there anyway to do the authentication in url?
for example, instead of curl:
curl -k -u myusername:mypassword "https://localhost:9443/oslc/workitems/1.json"

calling url:
https://localhost:9443/oslc/workitems/1.json?user=myusername&pass=mypassword

Thanks,
Julia

3 answers



permanent link
Patrick Streule (4.9k21) | answered Oct 01 '09, 4:24 a.m.
JAZZ DEVELOPER
in this article
https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2
there are examples for basic and form based authentication using
curl. Is there anyway to do the authentication in url?
for example, instead of curl:
curl -k -u myusername:mypassword
"https://localhost:9443/oslc/workitems/1.json"

calling url:
https://localhost:9443/oslc/workitems/1.json?user=myusername&pass=mypassword

You could try this:

https://user:password@localhost:9443/oslc/workitems/1.json


--
Regards,
Patrick
Jazz Work Item Team

permanent link
Julia Ballos (1835) | answered Oct 01 '09, 11:24 a.m.
Hi Patrick,

it doesnt work.
I'm getting an error message "windows cannot find 'https://user:password@localhost:9443/oslc/workitems/1.json'. Check the spelling and try again.".

Are you sure it is the correct format?

Julia.

permanent link
Patrick Streule (4.9k21) | answered Oct 01 '09, 1:20 p.m.
JAZZ DEVELOPER
I'm getting an error message "windows cannot find
'https://user:password@localhost:9443/oslc/workitems/1.json'. Check
the spelling and try again.".

Are you sure it is the correct format?

It would be the general format to include the user credentials in a URL,
but I haven't tried myself.
Authentication is handled by the web container, not by the RTC rest
implementation.

If you are trying this using a browser (as the error message suggests),
you don't need to include the credentials explicitly. Just use
https://localhost:9443/jazz/oslc/workitems/1.json

and you will be prompted for username/password.

--
Regards,
Patrick
Jazz Work Item Team

Your answer


Register or to post 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.