Re: [cas-user] Oauth2.0 not redirecting back to app

2016-10-05 Thread Marina Batet
Hi Jérôme,

Thanks for your answer!

Yes, I tested it with firebug and there are two calls to the /cas/login. 
The first with the service url and the second without.

The thing is, I have a custom theme defined for my service. If I use the 
default theme, then I have just one call and everything works fine.

But If I define a custom theme (that in itself it just contains some images 
and a css file, it have no calls whatsoever), then, I see two calls 
to  /cas/login in firebug.

And the culprit is the file WEB-INF/view/jsp/default/ui/includes/bottom.jsp:

">

That it's translated in:



As this file (/mytheme/js/cas.js) does not exist  (in the default theme 
/cas/js/cas.js *does* exists), this call it's redirected to /cas/login

I copied the cas/js/cas.js file to my js theme directory and problem 
solved! L¡Just one call to the method and the service it's not null.

Thanks so much for your help, much appreciated! :-)


El dimecres, 5 octubre de 2016 13:45:01 UTC+2, leleuj va escriure:
>
> Hi,
>
> Indeed, the double call to prepareForLoginPage is the culprit. Is there 
> any resource on your login page somehow calling the /login URL again?
>
> Thanks.
> Best regards,
> Jérôme
>
>
> 2016-10-05 13:28 GMT+02:00 Marina Batet <mba...@gmail.com >:
>
>> Hi Jérôme and everyone, 
>>
>> This is happening to me in CAS 4.2.3.
>>
>> I'm trying it in localhost, with two CAS servers installed, one acting as 
>> the oauth client (/cas) an the other as the oauth server 
>> (/cas-pac4j-oauth-server-demo). And a test app (/test-client-app) that it's 
>> acting as the client of the first cas (the service). There are no Apaches 
>> nor rewrites in this scenario...
>>
>> What I'm seeing is that before the login page it's loaded in the browser, 
>> I have two calls to the "prepareForLoginPage" method. In the first call, 
>> the service is stored in session OK. In the second call, the service is 
>> null (?) and the service attribute is overwrited in the session. 
>> Thereafter, when we try to retrieve the service after de oauth delegation, 
>> etc... the service attribute it's null.
>>
>> I have put some more traces in the ClientAction class and compiled it in 
>> order to try to understand what it's happening. I have attached the traces 
>> (just the ones before the login page) , but basically, what it's bugging me 
>> is:
>>
>> 2016-10-05 12:53:19,412 DEBUG 
>> [org.jasig.cas.support.pac4j.web.flow.ClientAction] - [prepareForLoginPage] 
>> save service: 
>> https://localhost:8443/test-client-app/j_spring_cas_security_check
>> ...
>> 2016-10-05 12:53:22,880 DEBUG 
>> [org.jasig.cas.support.pac4j.web.flow.ClientAction] - [prepareForLoginPage] 
>> save service: null
>>
>> Why it's this second call overwriting the service as null when it was 
>> previously stored?  What I'm doing wrong? 
>>
>> Thanks in advanced for any response!
>>
>>
>> Best regards,
>>
>> El dimecres, 5 octubre de 2016 10:43:05 UTC+2, leleuj va escriure:
>>>
>>> Hi,
>>>
>>> In the ClientAction, the service has been saved: 
>>>
>>> 2016-10-03 16:32:17,094 DEBUG 
>>> [org.jasig.cas.support.pac4j.web.flow.ClientAction] - save service: 
>>> https://localhost:8445/dipta-cas-client-test/j_spring_cas_security_check
>>>
>>> But, indeed, the service is not retrieved during the authentication 
>>> (thus no redirect back to the application):
>>>
>>> 2016-10-03 16:32:27,930 DEBUG 
>>> [org.jasig.cas.support.pac4j.web.flow.ClientAction] - retrieve service: null
>>>
>>> The service is saved into and restored from the web session: anything 
>>> special in your case?
>>>
>>> Thanks.
>>> Best regards,
>>> Jérôme
>>>
>>>
>>>
>>> 2016-10-04 12:26 GMT+02:00 Xavier Rodríguez <amg...@gmail.com>:
>>>
>>>> Hi,
>>>>
>>>> I've the same problem. We have installed CAS-4.2.3 with Client-Oauth 2 
>>>> implementation. But we are not able to come back to the service-app.
>>>>
>>>> When the user is autenticated in Server-Oauth it returns to the 
>>>> CAS-Server-client but it stops in login page showing that the user is 
>>>> authenticated, it seems that the service(app) in this point is lost, and 
>>>> it 
>>>> doesn't return to the app.
>>>>
>>>> We have defined in Pac4jContext:
>>>>
>>>> >>> class="cat.dipta.pac4j.oauth.client.ValidCasOAuthWrapperClient">
>>&

Re: [cas-user] Oauth2.0 not redirecting back to app

2016-10-05 Thread Marina Batet
Hi Jérôme and everyone, 

This is happening to me in CAS 4.2.3.

I'm trying it in localhost, with two CAS servers installed, one acting as 
the oauth client (/cas) an the other as the oauth server 
(/cas-pac4j-oauth-server-demo). And a test app (/test-client-app) that it's 
acting as the client of the first cas (the service). There are no Apaches 
nor rewrites in this scenario...

What I'm seeing is that before the login page it's loaded in the browser, I 
have two calls to the "prepareForLoginPage" method. In the first call, the 
service is stored in session OK. In the second call, the service is null 
(?) and the service attribute is overwrited in the session. Thereafter, 
when we try to retrieve the service after de oauth delegation, etc... the 
service attribute it's null.

I have put some more traces in the ClientAction class and compiled it in 
order to try to understand what it's happening. I have attached the traces 
(just the ones before the login page) , but basically, what it's bugging me 
is:

2016-10-05 12:53:19,412 DEBUG 
[org.jasig.cas.support.pac4j.web.flow.ClientAction] - [prepareForLoginPage] 
save service: 
https://localhost:8443/test-client-app/j_spring_cas_security_check
...
2016-10-05 12:53:22,880 DEBUG 
[org.jasig.cas.support.pac4j.web.flow.ClientAction] - [prepareForLoginPage] 
save service: null

Why it's this second call overwriting the service as null when it was 
previously stored?  What I'm doing wrong? 

Thanks in advanced for any response!


Best regards,

El dimecres, 5 octubre de 2016 10:43:05 UTC+2, leleuj va escriure:
>
> Hi,
>
> In the ClientAction, the service has been saved: 
>
> 2016-10-03 16:32:17,094 DEBUG 
> [org.jasig.cas.support.pac4j.web.flow.ClientAction] - save service: 
> https://localhost:8445/dipta-cas-client-test/j_spring_cas_security_check
>
> But, indeed, the service is not retrieved during the authentication (thus 
> no redirect back to the application):
>
> 2016-10-03 16:32:27,930 DEBUG 
> [org.jasig.cas.support.pac4j.web.flow.ClientAction] - retrieve service: null
>
> The service is saved into and restored from the web session: anything 
> special in your case?
>
> Thanks.
> Best regards,
> Jérôme
>
>
>
> 2016-10-04 12:26 GMT+02:00 Xavier Rodríguez  >:
>
>> Hi,
>>
>> I've the same problem. We have installed CAS-4.2.3 with Client-Oauth 2 
>> implementation. But we are not able to come back to the service-app.
>>
>> When the user is autenticated in Server-Oauth it returns to the 
>> CAS-Server-client but it stops in login page showing that the user is 
>> authenticated, it seems that the service(app) in this point is lost, and it 
>> doesn't return to the app.
>>
>> We have defined in Pac4jContext:
>>
>> > class="cat.dipta.pac4j.oauth.client.ValidCasOAuthWrapperClient">
>> 
>> 
>> https://localhost:8444/cas-pac4j-oauth-server-demo/oauth2.0; />
>> 
>> 
>> > class="org.pac4j.oauth.client.CasOAuthWrapperClient">
>> 
>> 
>> https://localhost:8444/cas-pac4j-oauth-server-demo/oauth2.0; />
>> 
>>
>> When CAS receives the data from de Oauth-Server its log shows:
>>
>> 2016-10-03 16:32:27,999 DEBUG 
>> [org.jasig.cas.authentication.DefaultAuthenticationContextBuilder] - 
>> Building an authentication context for authentication 
>> org.jasig.cas.authentication.ImmutableAuthentication@75b86cb and service 
>> null
>>
>> I understand that this service must have the url of the client-app but it 
>> is null. ¿Do We have to define some extra variable?
>>
>> Best regards,
>>
>> - Xavier -
>>
>> El divendres, 30 setembre de 2016 8:12:06 UTC+2, leleuj va escriure:
>>>
>>> Hi,
>>>
>>> Which CAS version do you use? Any error in your logs?
>>>
>>> Thanks.
>>> Best regards,
>>> Jérôme
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "CAS Community" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to cas-user+u...@apereo.org .
>> To post to this group, send email to cas-...@apereo.org .
>> Visit this group at 
>> https://groups.google.com/a/apereo.org/group/cas-user/.
>> To view this discussion on the web visit 
>> https://groups.google.com/a/apereo.org/d/msgid/cas-user/e3c65f13-e58d-4159-8573-32b17e290eaf%40apereo.org
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/a/apereo.org/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cas-user+unsubscr...@apereo.org.
To post to this group, send email to cas-user@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit