OSLC workshop (Access RM programmatically) : Error 417, Expectation Failed during form based authentication.
Hi,
I am running the OSLC Workshop and trying to run example03.java net.jazz.oslc.consumer.rm.client package.
I am running it against 6.0.6.1 and iFix017
The form based authentication post query return Error 417, Expectation failed at line179 as shown below. Is this a issue with form based authentication, if yes how to get rid of it?
Output log of the execution:
>> Example03: Print out the content of the Service Providers catalog
- Root Services URI: https://aeroclm.honeywell.com/rm/rootservices
- Service Providers catalog XPath expression: /rdf:Description/oslc_rm:rmServiceProviders/@rdf:resource
- Service Provider title XPath expression: //oslc:ServiceProvider/dcterms:title
- Login: XXXXX
- Password: XXXX
>> GET(1) https://aeroclm.honeywell.com/rm/rootservices
>> Response Headers:
- Date: Wed, 24 Nov 2021 07:34:33 GMT
- Server: Apache
- Strict-Transport-Security: max-age=31536000
- ETag: "gknF/vzdWmHdxB4rzsSKaXvC7dE="
- Expires: Wed, 24 Nov 2021 07:39:33 GMT
- Cache-Control: public
- Content-Type: application/rdf+xml; charset=UTF-8
- Content-Language: en-US
- Keep-Alive: timeout=5, max=86
- Connection: Keep-Alive
- Transfer-Encoding: chunked
- Strict-Transport-Security: max-age=157680000
>> GET(1) https://aeroclm.honeywell.com/rm/oslc_rm/catalog
Nov 24, 2021 1:04:43 PM org.apache.http.client.protocol.ResponseProcessCookies processCookies
WARNING: Invalid cookie header: "Set-Cookie: jfs-request-token-843b7728b2f545da811551f0de556cab="EUoIwSfRo532nvIEMdDCPTNaUo5dbitZ8Xsyz2q6g"; Version=1; Max-Age=600; Expires=Wed, 24-Nov-2021 07:44:43 GMT; Path=/rm; secure; HttpOnly". Unable to parse expires attribute: Wed
>> Response Headers:
- Date: Wed, 24 Nov 2021 07:34:43 GMT
- Server: Apache
- Strict-Transport-Security: max-age=31536000
- X-com-ibm-team-repository-web-auth-msg: authrequired
- X-XSS-Protection: 1; mode=block
- Content-Type: text/html; charset=UTF-8
- Content-Language: en-US
- Expires: Thu, 01 Dec 1994 16:00:00 GMT
- Cache-Control: no-cache="set-cookie, set-cookie2"
- Set-Cookie: JazzFormAuth=Form; Path=/jts; Secure
- Keep-Alive: timeout=5, max=40
- Connection: Keep-Alive
- Transfer-Encoding: chunked
- Strict-Transport-Security: max-age=157680000
>> POST https://aeroclm.honeywell.com/jts/j_security_check
- Date: Wed, 24 Nov 2021 07:35:29 GMT
- Server: Apache
- Content-Length: 312
- Connection: close
- Content-Type: text/html; charset=iso-8859-1
- Strict-Transport-Security: max-age=157680000
org.apache.http.auth.InvalidCredentialsException: Authentication failed
at net.jazz.oslc.utils.HttpUtils.doRRCOAuth(HttpUtils.java:232)
at net.jazz.oslc.utils.HttpUtils.sendGetForSecureDocument(HttpUtils.java:264)
at examples.Example03.main(Example03.java:92)
One answer
I've never tried what you're doing, but the message "org.apache.http.auth.InvalidCredentialsException: Authentication failed" would seem to indicate that the credentials you're using aren't valid.