omniauth-cas icon indicating copy to clipboard operation
omniauth-cas copied to clipboard

Service URL error

Open brenard opened this issue 9 years ago • 1 comments

Hi,

I'm using omniauth-cas (version 1.1.0) with the last Gitlab release (8.3.2) and I have an issue with service URL pass to CAS Server : This URL is not the same during the login step and the serviceValidate step :

URL pass during the login step :

https://gitlab.easter-eggs.com/users/auth/cas/callback?url

URL pass during the serviceValidate step :

https://gitlab.easter-eggs.com/users/auth/cas/callback?url=

I try to understand why the url parameter is added to the URL and I locate the problem in the method return_url() in file lib/omniauth/strategies/cas.rb. If I understand, this method try to detect if an url parameter is already present in the current request and if it's not, it's try to add the request referer as url parameter. In my case, the request referer seem to be empty.

To solve my problem, I replace the method return_url() with this one :

def return_url
    {}
end

With this method, the service URL is the same during two step :

https://gitlab.easter-eggs.com/users/auth/cas/callback?

My work-around is certainly not a good solution but I don't understand the utility of this url parameter.

Regard

brenard avatar Dec 29 '15 16:12 brenard

Given that @dlindahl is no longer maintaining this gem I might suggest looking at saml auth. It is the one of the default/built in auth systems in gitlab. If your CAS provider is using Jasig-cas the last couple versions are capable of provided SAML credentials.

eriko avatar Dec 29 '15 17:12 eriko