[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Logon to Orion with curl

I'm trying myself right now but...   I think you want "-b" not "-c" in this case

try:
1) "http://localhost:8080/login/form"
2) send just "login" and "password"
 -- that's what I see in the network tab when I post my login info from the UI.

Incidentally I get a 401 to this request if I have a bad username/password

-Simon

Inactive hide details for Christian Halstrick ---01/28/2013 11:34:25 AM---Hi, if I execute the following two commandsChristian Halstrick ---01/28/2013 11:34:25 AM---Hi, if I execute the following two commands


    From:

Christian Halstrick <christian.halstrick@xxxxxxxxx>

    To:

Orion developer discussions <orion-dev@xxxxxxxxxxx>,

    Date:

01/28/2013 11:34 AM

    Subject:

Re: [orion-dev] Logon to Orion with curl

    Sent by:

orion-dev-bounces@xxxxxxxxxxx




Hi,

if I execute the following two commands

curl -i -v -c orion_cookies.txt -d 'store=Orion' -d 'login=user' -d
'password=user'
http://localhost:8080/login
curl -i -v -b orion_cookies.txt -H "EclipseWeb-Version: 1.0"
http://localhost:8080/workspace

the I get the response I added to the end of the mail. You can see
that the during the first call I try to login
and as consequence of that a cookie is set. I tell curl to save the
cookie in cookies.txt. In the second
call I reuse that cookie and you can see from the request that I
really sent the JSESSIONID which I got
during login. But: it seems that the sessionID which I get back is not
correct. If I sent a wrong password
during the login call the server also answers with a cookie. I cannot
from the response to the login request
which I am succesfully logged in. Good or bad credentials: I always
get 200 OK and a cookie back.

Ciao
 Chris

----------------------------------------------
+ curl -i -v -c orion_cookies.txt -d store=Orion -d login=user -d
password=user
http://localhost:8080/login
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /login HTTP/1.1
> User-Agent: curl/7.27.0
> Host: localhost:8080
> Accept: */*
> Content-Length: 36
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 36 out of 36 bytes
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 200 OK
HTTP/1.1 200 OK
* Added cookie JSESSIONID="1v2zxxcf0mgg6ajhsopfzzjio" for domain
localhost, path /, expire 0
< Set-Cookie: JSESSIONID=1v2zxxcf0mgg6ajhsopfzzjio;Path=/
Set-Cookie: JSESSIONID=1v2zxxcf0mgg6ajhsopfzzjio;Path=/
< Expires: Thu, 01 Jan 1970 00:00:00 GMT
Expires: Thu, 01 Jan 1970 00:00:00 GMT
< Content-Length: 0
Content-Length: 0
< Server: Jetty(8.1.3.v20120522)
Server: Jetty(8.1.3.v20120522)

<
* Connection #0 to host localhost left intact
* Closing connection #0
+ curl -i -v -b orion_cookies.txt -H 'EclipseWeb-Version: 1.0'
http://localhost:8080/workspace
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /workspace HTTP/1.1
> User-Agent: curl/7.27.0
> Host: localhost:8080
> Accept: */*
> Cookie: JSESSIONID=1v2zxxcf0mgg6ajhsopfzzjio
> EclipseWeb-Version: 1.0
>
* additional stuff not fine transfer.c:1037: 0 0
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 302 Found
HTTP/1.1 302 Found
< WWW-Authenticate: FORM
WWW-Authenticate: FORM
< Location:
http://localhost:8080/mixloginstatic/LoginWindow.html?redirect=http://localhost:8080/workspace
Location:
http://localhost:8080/mixloginstatic/LoginWindow.html?redirect=http://localhost:8080/workspace
< Content-Length: 0
Content-Length: 0
< Server: Jetty(8.1.3.v20120522)
Server: Jetty(8.1.3.v20120522)

<
* Connection #0 to host localhost left intact
* Closing connection #0
----------------------------------------------
_______________________________________________
orion-dev mailing list
orion-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/orion-dev



GIF image

GIF image