Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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.

0 votes



2 answers

Permanent link

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. 

0 votes


Permanent link

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: Basic header 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 the Authorization header to the URI returned by the X-JSA-APP-PASSWORD-REDIRECT header (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.

0 votes

Comments

Above is for JAS+SAML without MFA - MFA is a completely different ballgame which I haven't tried playing :-o

Also note application passwords once they've been used once with one app are tied to that app and can't be used to authenticate with a different app. This is how application passwords work in Liberty, and ELM just uses the Liberty feature as it works.


And another point is that when using an application password the userid has to be the same case as the LDAP user id. Whereas JTS/JAS can be configured for case-insensitive user id so fred would match Fred, but that isn't the case (haha) for application passwords: if the real user id is FrEd then that's what you have to use for the application password to work even though ELM login may accept fred, FRED, FREd if configured for case insensitivity. Again this is just how application passwords work in Liberty and ELM just uses the Liberty feature as it works.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 11,074
× 7,592
× 1,422

Question asked: Nov 26, 2:40 a.m.

Question was seen: 346 times

Last updated: Dec 03, 4:51 a.m.

Confirmation Cancel Confirm