how to resolve the authentication issue while getting data with python request ?
I am making an authentication request with Python's requests package, to fetch Test Plan details and further processing, from MY_PROJECT.
Right in the beginning of it I am facing the authorization issue, despite getting a 200 status. Details : 1. URL = https://MY_PROJECT/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/
2. response = requests.get(URL, auth = (MY_UN, MY_PW), verify=False) 3. I have verified the browser to have Java - Auto Enabled 4. Experimented with passing header, but to no avail :5. Experimented with Proxies as well, and it seems to be fine on that front._headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/'
'537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'
}
For the above request,
I am getting notably these texts :
1. <Javascript is either disabled or not available in your Browser> ...
2. <net.jazz.ajax.ui.PlatformUI.createAndRunWorkbench("net.jazz.web.app.authrequired")>
Requesting if there is someway in which I can solve this issue ?
pasting a sample output for reference
Output -
<!DOCTYPE html>
<body class="claro"><noscript><div id="net-jazz-ajax-NoScriptMessage">Javascript is either disabled or not available in your Browser</div></noscript>
<div id="net-jazz-ajax-InitialLoadMessage">Loading...</div>
<div id="net-jazz-ajax-WorkbenchRoot"></div>
.
.
.<script type="text/javascript">
/* <![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.authrequired");
});
});
/* ]]> */
/script>
</body>
</html><200>
Process finished with exit code 0
One answer
Basically, you are not authenticated and you need a session.
There are different authentication schemas dependent on how your server is configured. Please see: https://rsjazz.wordpress.com/2021/10/15/elm-authentication/ which is based on https://jazz.net/wiki/bin/view/Main/NativeClientAuthentication .