Observed unknow behavior while using REST-Service url with curl script in IBM ALM server
Our developer teams have provided one REST service url (syntax below) to get the components details from the stream:
https<servername>/service/xyz.server.scm.metadata.IPersistWorkspaceMetadataService?StreamName=<Stream-name>&SnapshotName=<lSnaphot-name>
This service has been deployed on alm-007 server and alm-008 server. So, the service is available on both server.
And the above Rest service call, I am call on command prompt with below script.
set USER=ABC
set PWD=****
set COOKIES=cookies.txt
curl.exe -k -c %COOKIES% https:// alm-007/cm/authenticated/identity
curl.exe -k -L -b %COOKIES% -c %COOKIES% -d j_username=%USER% -d j_password=%PWD% https:// alm-007/cm /authenticated/j_security_check
curl.exe -k -b %COOKIES% "https:// alm-007/cm/service/ service/xyz.server.scm.metadata.IPersistWorkspaceMetadataService?StreamName=PQR_JKL-FS_Stream1&SnapshotName= PQR_JKL-FS_Snapshot1" -o output.txt
With alm-007 server the above script is working fine, all the information I can see on the generated output.txt file. But in case of alm-008 server same script is not working.
Its say authfailed. Response script from server in command prompt
<html>
<body>
………
…………
/ <![CDATA[ /
require(["dojo/ready", "dojo/parser", "dijit/registry", "dijit/Dialog"], function(ready, parser, registry){
ready(function(){
net.jazz.ajax.ui.PlatformUI.createAndRunWorkbench("net.jazz.web.app.authfailed");
});
});
/ ]]> /
</script>
</body>
What will be region for this. I couldn’t be able to understand the behavior of server. Or Is my approach is wrong ?
Note : Both the server has SSO.
One answer
You receive this response when you are not correctly sending Authentication information to the API. I have two blog posts that explain both Oauth1.0a and OIDC authentication with ELM servers... Here's OIDC - API Authentication Method in ELM – OIDC and here's OAuth1.0a API Authentication Method in ELM – Oauth 1.0a