0

I am currently trying to access Jira REST with Jersey. The problem is that for our Jira a single sign on is set up. Authentication with "client.addFilter(new HTTPBasicAuthFilter(..." does not work. If I access Jira via browser and then hardcode the received cookie into Jersey I am able to access Jira REST.

My question would now be how to login with Jersey over SSO. From what I can see clicking "Login" on the SSO page just sends a POST request with a request body like "username=&password=&login-form-type=pwd". So I should be able to retrieve a cookie with Jersey the same way I guess...

Cheers!

Luigi04
  • 437
  • 5
  • 14

1 Answers1

0

I managed to get it done with Selenium Ghost Driver.

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
                "/Path/to/bin/phantomjs");                  
driver = new PhantomJSDriver(caps);

Afterwards I use the driver to enter username and password, log in, get the new cookie and then use this cookie with Jersey.

Might not be the ideal way but it works.

How to run ghostdriver with Selenium using java

Luigi04
  • 437
  • 5
  • 14