2

I have a web service for which the user authentication is provided by web browser Single Sign-On authentication method , through which a human user is automatically logged in with his/her company email ID from a web browser.

I have written a java Jersey 2.x client (a non human consumer of web service). In client code I am using HttpAuth as

HttpAuthenticationFeature feature = HttpAuthenticationFeature.basic("ENTER_USERNAME_HERE", "PASSWORD_HERE");

But the client fails stating the HTTP status code as 302 (redirection error) Then I used curl for the same and received the response as an HTML page stating The document is moved here(<-- a link containing websso url to my resource). After searching on SO I enabled the FollowsRedirection feature for my jersey client and now the error is changed to

Exception in thread "main" javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized

Any pointer on how to handle this authentication problem ?

Community
  • 1
  • 1
Saurabh Bhoomkar
  • 595
  • 1
  • 9
  • 29

1 Answers1

3

The issue was finally resolved , so I am going to answer my own question,

After all the RnD , it was clear that there isn't any sophisticated way for passing (Authenticating) the WEb SSO (Single Sign-On) from jeresy 2.x client code. Although I found some interesting articles regarding kerberos here and here.

So , finally I created an other URL path as
/AuthWithCert CONTEXT in server proxy configuration and added the requests coming from this path as an exclusion in webSSO login conf. So automatically the authentication was pointed to default (HttpBasic Client Auth) without any redirection error and the client worked fine.

Community
  • 1
  • 1
Saurabh Bhoomkar
  • 595
  • 1
  • 9
  • 29