Accessing ELM's REST/OSLC APIs when SSO is enabled using SAML.
Hi,
I am trying to access OSLC/REST APIs from IBM ELM(specifically ERM) but I keep receiving 401 Unauthorised response. Since, my ELM is configured with SSO using SAML for authentication I tried using App passwords/tokens and Basic Auth.
Is there any official documentation or recommended approach on how to access ELM's OSLC/Rest APIs when SSO is enabled using SAML.
2 answers
I would carefully follow https://rsjazz.wordpress.com/2021/10/15/elm-authentication/ for topics not covered use google search my questions site:jazz.net.
So you're using JAS with SAML? It's definitely possible to get application passwords to work - see this for overview https://jazz.net/wiki/bin/view/Main/ApplicationPasswordsForNativeClients and this for the detailed steps to authenticate https://jazz.net/wiki/bin/view/Main/ApplicationPasswordsAdoption in the section "Revised flow using application password".
What I found implementing this in Python was that at the final step, and contrary to the advice to automatically follow redirects, at the point where the doc says:
-
If it is determined that the response is either a SAML challenge, an OIDC redirect, or a Kerberos challenge, the client forms an
Authorization: Basicheader with username and password credentials encoded as per Basic, but the password must be an application password that was obtained from the JAS by the user. The client sends a GET request with theAuthorizationheader to the URI returned by theX-JSA-APP-PASSWORD-REDIRECTheader (which it remembered from step 2).
you MUST make sure to send this GET with automatic following of redirects disabled! You'll get a 302 redirect which you don't follow, instead explicitly repeat the original request (i.e. with body+headers) and you'll be authenticated with the cookie arriving on the response to this original request :-)
If you allow automatic redirects the original operation+URL is sent but without the headers of the original request - for me this always failed and that meant the authentication always failed, i.e. 401 and no cookie.
FYI you should avoid the OAuth 2.0 credentials grant - that's intended for application-to-application use and is unlikely to comply with most corporate cyber security requirements because for example the grant is valid until revoked so doesn't comply with the need for users to regularly change password.