I'd like to use script to automatically fetch the workorder or asset status data through API of our maximo asset management system. The maximo asset management version is 7.6.1.2 and I referred to the document (https://www.ibm.com/support/pages/creating-and-using-rest-api-keys-secure-application-server-environment), had asked our maximo admin to generate a API key for me and wrote the code as following. However, the apikey seems not work and I'm still asked to login through SAML.
I tried to use python requests to get data. And as for the first step, I tried if I can successfully use the apikey to get access to the maximo database.
import urllib3
import requests
url ='https://<mymaximohost>/maximo/api/os/mxapiwodetail?
header= {"Accept":"application/json",
"Content-Type": 'application/json',
"x-public-uri": 'https://<mymaximohost>/maximo/api'
param={
"apikey": "<myapikey>",
"lean":1}
r=requests.get(url, headers=header, params=param)
print(r.content)
The printed content is the xml content of our company's SAML login page.
In fact, even if I manually type the link to visit the maximo like "https://mymaximohost/maximo/api/?apikey=myapikey, it will still redirect to the SAML login page.
I'm only an amateur at writing python script and don't have enough knowledge regarding website. Could anyone tell me if anything wrong?
It sounds to me like you would need to refine your filter for SAML TAI in WebSphere. From memory:
Security > Global securitythen over on the right will be a link to take you to the list of Trust interceptors, then picking the Saml one will list the sso_1.param list, and there is a filter in that param list that matches the URL you are calling. Maybe you need to add another Virtual Host with a different host name that is not in that filter.Look up the IBM guide on setting up SAML SSO for Maximo, it will help you find the place I'm talking about.