dlindahl / omniauth-cas

A CAS OmniAuth Strategy
MIT License
88 stars 79 forks source link

Service URL error #42

Open brenard opened 8 years ago

brenard commented 8 years ago

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 _returnurl() 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

eriko commented 8 years ago

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.