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

Bug 492429

Summary: [drupal] Site login should support login/sso?redirect path for MPC favorites
Product: Community Reporter: Jens Reimann <jreimann>
Component: MarketplaceAssignee: Eric Poirier <eric.poirier>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P1 CC: chris.guindon, eric.poirier, reckord
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Jens Reimann CLA 2016-04-26 05:07:36 EDT
Clicking on the "star" button in the market place dialog asks the user to follow to the marketplace webpage.

But instead of the expected web page the users gets to a 404 page [1].

This happened to me for the "yedit" plugin from the Eclipse Marketplace.

[1] https://marketplace.eclipse.org/login/sso%3Fredirect%3Dnode/949
Comment 1 Eric Poirier CLA 2016-04-26 09:57:45 EDT
Hi Jens,

Are you logged in when you try to add a plugin in your favorites? I'm getting a similar error when I'm not logged in but I can't get the 404 page.

Can you elaborate a little bit more about the steps you take to get the 404 page.

Thanks.
Comment 2 Carsten Reckord CLA 2016-04-26 10:39:34 EDT
Before Neon, the Marketplace Client wasn't able to change the favorite status of an entry itself. Instead it redirects users to the entry's site on marketplace.eclipse.org.

Since you need to be logged in in order to change the favorite, but MPC has no way to check if you are already logged in, it always redirects you via the login page, which should forward you to the entry page after login (or immediately if you are already logged in).

The URL that is used is hard-coded as https://marketplace.eclipse.org/login/sso?redirect=<entry>. Apparently, that link is now broken. It immediately redirects to the url-encoded form https://marketplace.eclipse.org/login/sso%3Fredirect%3D<entry> which results in the 404.
Comment 3 Jens Reimann CLA 2016-04-26 10:40:42 EDT
I have to admit, I am not a 100% sure if I am logged in. In general, yes, I am logged in. However in most cases, my session expired and I have to re-login. But this is only a matter of clicking the "login" button, and I don't have to enter any credentials. This is the best way I can describe it.

I do think that in this scenario I was logged in (in general) but the session expired.

I make another test:

1) I am logged in. The market place greets me with "Welcome, ..." in the header sections. Clicking the button causes a redirect to https://marketplace.eclipse.org/login/sso?redirect=node/2231050

2) I logged out. The button takes me to https://dev.eclipse.org/site_login/?takemeback=https%3A//marketplace.eclipse.org/user/login/sso%3Fdestination%3Dnode/2231050, after logging in, it takes me to the correct page

3) I am still logged it (after I logged in in #2), same effect as #1
Comment 4 Carsten Reckord CLA 2016-04-26 10:55:02 EDT
Ah, I can see what's going on. Apparently the redirect parameter name was changed...

This works:
https://marketplace.eclipse.org/login/sso?destination=node/2231050

And this doesn't:
https://marketplace.eclipse.org/login/sso?redirect=node/2231050

MPC still uses the latter...
Comment 5 Christopher Guindon CLA 2016-04-27 12:19:05 EDT
(In reply to Carsten Reckord from comment #4)
> Ah, I can see what's going on. Apparently the redirect parameter name was
> changed...
> 
> This works:
> https://marketplace.eclipse.org/login/sso?destination=node/2231050
> 
> And this doesn't:
> https://marketplace.eclipse.org/login/sso?redirect=node/2231050
> 
> MPC still uses the latter...

I see, we will need to support this old site_login path for MPC.
Comment 6 Christopher Guindon CLA 2016-11-08 10:53:31 EST
I also see a 404 page, when I click add content and I am not logged in.

I am redirected to accounts.eclipse.org to login but when I am redirected back to marketplace, I see a 404 page.

This needs to be revolved ASAP. I am upping the priority since this bugs exists in all sites using our site login module.

--- 

To be clear, there is two issues we need to solve here. 

-Fixing the redirect url when clicking on add content.
-Support login/sso for older versions of MPC
Comment 7 Eric Poirier CLA 2017-03-20 10:39:31 EDT
(In reply to Christopher Guindon from comment #6)
> I also see a 404 page, when I click add content and I am not logged in.
> 
> I am redirected to accounts.eclipse.org to login but when I am redirected
> back to marketplace, I see a 404 page.
> 
> This needs to be revolved ASAP. I am upping the priority since this bugs
> exists in all sites using our site login module.
> 
> --- 
> 
> To be clear, there is two issues we need to solve here. 
> 
> -Fixing the redirect url when clicking on add content.
> -Support login/sso for older versions of MPC

Both these issues have been fixed overtime.

The add content link doesn't redirect to a 404 page and the login/sso path is still supported and redirects to user/login.

I'll close this bug as fixed since the issues have been fixed.

Please reopen if one of these links doesn't have to correct behaviour.

Thanks.