Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 410704

Summary: Support for CAS SSO
Product: z_Archived Reporter: Abhijit Gurav <abhijit.gurav>
Component: MylynAssignee: Project Inbox <mylyn-triaged>
Status: CLOSED MOVED QA Contact:
Severity: enhancement    
Priority: P4 CC: andermaj, joerg.sesterhenn, steffen.pingel, tom.gl
Version: 1.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 328723    
Attachments:
Description Flags
Added CookieStore
none
Setting Cookies if provided none

Description Abhijit Gurav CLA 2013-06-13 07:25:10 EDT
Hi,

I'm trying to add build Repository as a Mylyn build repository, using our Jenkins server URL and my normal username and single-sign-on password (We have our Jenkins instance integrated with Single Sign-On login).

From browser let me explain this process, We use CAS for authentication.

When user login to our portal it will be redirect to another (SSL secured) server with an HTML page. If you enter your correct credentials there you are redirected to the original portal with a token appended to the URL like ?ticket=ST-547-uMsCT01Q5mJhnOih0O1e-cas.

From there we facilitate user to go to his/her Jenkins job, here when user clicks on the same, browser redirect it to cas login page, but since we have valid session id cookies and ticket it's append this to url and redirect to Jenkins with successful login.

Now problem here is when I tried to give Jenkins URL directly in Mylyn Jenkins Connector, it's give Forbidden error and it's return 403 error internally.

I done some workaround on this by taking class org.eclipse.mylyn.internal.hudson.core.client.RestfulHudsonClient outside and adding managing redirection internally and setting valid cookies, session id to CommonHttpClient#httpClient.

It works fine but since when tried to add that server and job to build view and refresh connector. It's called internal instance of  RestfulHudsonClient which outsource don't have valid cookies and it's fails.

so is there any way i can handle that.
Comment 1 Abhijit Gurav CLA 2013-06-13 07:33:26 EDT
Correcting typo mistake in last paragraph,

It works fine but since when tried to add that server and job to build view and refresh connector. It's called internal instance of  RestfulHudsonClient which of course don't have valid cookies and it's fails.
Comment 2 Tomasz Zarna CLA 2013-06-13 11:45:14 EDT
This sounds like an enhancement request to me.
Comment 3 Abhijit Gurav CLA 2013-06-19 00:57:12 EDT
Hi Tomasz,

Thanks for reply, should I consider that, the above request will be taken care in new upcoming release or do we have seperate process to have this.

Please suggest.

Thanks and Regards,
Abhijit Gurav
Comment 4 Steffen Pingel CLA 2013-06-19 04:43:50 EDT
Thank you for your request. It does not fall into the core scope of the project and due to time constraints we are unable to resolve it at the moment. The bug has been marked helpwanted though to indicate that we would be happy to support a community contribution to resolve it.
Comment 5 Abhijit Gurav CLA 2013-06-25 02:53:15 EDT
Created attachment 232714 [details]
Added CookieStore

Hi Steffen,

Thanks for reply,

I worked on the same, my first way was to make our own RestfulHudsonClient and contribute through extension point. 
But As I observed in org.eclipse.mylyn.builds.internal.core.operations.RefreshSession 
while refreshing Build view, through org.eclipse.mylyn.internal.builds.ui.BuildsUiInternal
it takes different instance of RestfulHudsonClient.  

Hence I came with new approach to add ability to cookies in  RestfulHudsonClient, with help of org.eclipse.mylyn.commons.repositories.core.RepositoryLocation
As we set some of the UserCredentials through RepositoryLocation only.

So from user point of view, who wish to add some servers and plans programmatically in BuildsView. 
They can create desired RepositoryLocation with valid cookies added to it.Like, location.setCookieStore(cookieStore);  

With other part same as what used to perform by taking HudsonServerBehaviour and calling desired method.

I am attaching two patches
1)	Added-cookieStore.patch : this is for RepositoryLocation from org.eclipse.mylyn.commons.repositories.core project.
2)	Setting-Cookies-if-provided-by-Repository-location.patch : this is for RestfulHudsonClient from org.eclipse.mylyn.hudson.core for adding ability to add cookies in client.

Let me know the validity of this patch and can this be added to next future released.

Regards,
Abhijit Gurav
Comment 6 Abhijit Gurav CLA 2013-06-25 02:54:28 EDT
Created attachment 232715 [details]
Setting Cookies if provided

Adding 2nd patch (Setting-Cookies-if-provided-by-Repository-location.patch)
Comment 7 Abhijit Gurav CLA 2013-07-31 08:42:24 EDT
Hi Team,

Can you please let me know that, is my patch is validated and if all ok with patch then when that can be integrated for future release.

Thanks and Regards,
Abhijit Gurav
Comment 8 Jörg Sesterhenn CLA 2014-04-15 02:05:43 EDT
Please raise the priority of this bug. SSO via CAS is not unusual and we need it to be supported!
Comment 9 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn