oAuth - login problemer
HejJeg forsøger at forstå noget java kode hvor apache også bruges.
Hele ideen med koden er, at jeg skal have fat i min server som er beskyttet af en oAuth adgangstilladelse.
Jeg forsøger at skrive mine response headers ud. Er der nogle af jer som kan forstå hvad der foregår, og evt kan hjælpe?
>> Example03: Print out the content of the Service Providers catalog
- Root Services URI: https://myRMserver:9443/rm/rootservices
- Service Providers catalog XPath expression: /rdf:Description/oslc_rm:rmServiceProviders/@rdf:resource
- Service Provider title XPath expression: //oslc:ServiceProvider/dcterms:title
- Login: login
- Password: password
>> GET(1) https://myRMserver:9443/rm/rootservices
>> Response Headers:
- X-RRS-servername: "0"
- OSLC-Core-Version: 2.0
- Content-Type: application/rdf+xml
- Expires: Thu, 25 Apr 2013 09:21:00 CEST
- Cache-Control: public
- Content-Language: en-US
- Transfer-Encoding: chunked
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
>> statusline: OK 200
>> GET(1) https://myRMserver:9443/rm/discovery/RMCatalog
25-04-2013 09:16:01 org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-someNumber="someNumber2"; Version=1; Max-Age=600; Expires=Thu, 25-Apr-2013 07:26:00 GMT; Path=/rm". Unable to parse expires attribute: Thu
>> Response Headers:
- Set-Cookie: jfs-oauth-access-token0=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Path=/rm
- Set-Cookie: jfs-oauth-access_token-secret0=; Max-Age=0; Expires=Thu, 01-Jan-1970 00:00:00 GMT; Path=/rm
- Set-Cookie: jfs-request-token-someNumber="someNumber2"; Version=1; Max-Age=600; Expires=Thu, 25-Apr-2013 07:26:00 GMT; Path=/rm
- X-jazz-web-oauth-url: https://myJTSserver:9443/jts/oauth-authorize?oauth_token=someNumber
- WWW-Authenticate: OAuth realm=https://myJTSserver:9443/jts/oauth-authorize
- Content-Type: text/html
- Content-Length: 328
- Content-Language: en-US
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
>> statusline: Unauthorized 401
25-04-2013 09:16:01 org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm=https://myJTSserver:9443/jts/oauth-authorize}
>> Response Headers (First GET):
- X-com-ibm-team-repository-web-auth-msg: authrequired
- Location: https://myJTSserver:9443/jts/authenticated/identity?redirectPath=%2Fjts%2Foauth-authorize%3Foauth_token%3DsomeNumber
- Content-Language: en-US
- Content-Length: 0
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
>> statusline: Found 302
>> Response Headers (Second GET):
- Location: https://myJTSserver:9443/jts/auth/authrequired
- Content-Language: en-US
- Content-Length: 0
- Set-Cookie: WASReqURL=https://:9443/jts/authenticated/identity?redirectPath=%252Fjts%252Foauth-authorize%253Foauth_token%253DsomeNumber; Path=/
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
>> statusline: Found 302
>> Login form request line: POST https://myJTSserver:9443/jts/j_security_check HTTP/1.1
>> Login form get entry: org.apache.http.client.entity.UrlEncodedFormEntity@72fc72fc
>> POST to login formhttps://myJTSserver:9443/jts/j_security_check
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
- Location: https://myJTSserver:9443/jts/authenticated/identity?redirectPath=%2Fjts%2Foauth-authorize%3Foauth_token%3DsomeNumber
- Content-Language: en-US
- Content-Length: 0
- Set-Cookie: WASReqURL=""; Expires=Thu, 01-Dec-94 16:00:00 GMT; Path=/
- Set-Cookie: LtpaToken2=A-very-long-string-that-I-didn't-understand==; Path=/; Secure
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
>> statusline: Found 302
>> Response Headers (Third GET):
- Location: https://myJTSserver:9443/jts/oauth-authorize?oauth_token=someNumber
- Content-Language: en-US
- Content-Length: 0
- Set-Cookie: JSESSIONID=0000IP8Kbq-2viC7EWOegYxte6Y:-1; Path=/
- Set-Cookie: X-com-ibm-team-foundation-auth-loop-avoidance=false
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
>> statusline: Found 302
>> POST (create the login form)https://myJTSserver:9443/jts/j_security_check
- Location: https://myJTSserver:9443/jts/auth/authfailed
- Content-Language: en-US
- Content-Length: 0
- Date: Thu, 25 Apr 2013 07:16:00 GMT
- Server: WebSphere Application Server/7.0
>> statusline: Found 302
25-04-2013 09:16:01 org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-someNumber3="someNumber4"; Version=1; Max-Age=600; Expires=Thu, 25-Apr-2013 07:26:01 GMT; Path=/rm". Unable to parse expires attribute: Thu
25-04-2013 09:16:01 org.apache.http.impl.client.DefaultRequestDirector handleResponse
WARNING: Authentication error: Unable to respond to any of these challenges: {oauth=WWW-Authenticate: OAuth realm=https://myJTSserver:9443/jts/oauth-authorize}
>> Login was required (GET): Unauthorized 401