Search code examples
authenticationmaximo

Maximo login - REST command


I am trying to login to Maximo using the REST API; however, it just displays the login html content.

As per the IBM documentation:

POST /oslc/login
Authorization: BASIC <base64 encoded user:pass>

<no body required>

I tried this both on curl and via Postman. The results on both just display the Maximo login html content and does not login.

curl --location --request POST 'https://domain/maximo/oslc/login' --header 'Authorization: Basic c5hhcmKJMTJ6aW4uaPJtLm89uEp91p13aXK900UgHjE8ODQ='

The username and password I encoded are valid.

I’m not sure why this fails to login: Any input would be greatly appreciated.


Solution

  • That Base64 string you are using for authentication doesn't decode correctly. If that wasn't on purpose (say as an example for this question), then that would be a source of trouble. Remember to take the username, append a colon, then append the password to get your source string, then base64 encode all of that.

    For example, if your username is "maxuser" and that user's password is "maxpass", your source string would be "maxuser:maxpass", which then base64 encodes to "bWF4dXNlcjptYXhwYXNz"

    There is also the consideration of if you are using LDAP or not. The header you have provided here is for LDAP. If you are having Maximo itself authenticate the users, then you should be using the "maxauth" header instead (and don't prepend the "Basic " text). I.e. --header 'maxauth: bWF4dXNlcjptYXhwYXNz'