Thanks for the suggestions.

Going with my scenario, first, user logins to A via CAS, then, AngularJS
calls B.  There is no session for B, so the REST call returns 401, however,
we should not be asking user to login again, since he already logged into
A.  A and B are SSO via CAS.

What we need to do is to get CAS login flow to work in Ajax just as it is
in browser.

The issue with redirect you provided is when B session expires. A won't
know, thus, there is not a way to repeat the redirect trick. Further, we
likely will have B, C, E all as REST services backend, that gets a little
hard to manage.

Thanks,
Yan

On Thu, Nov 3, 2016 at 12:02 PM, Pascal Rigaux <pascal.rig...@univ-paris1.fr
> wrote:

> On 02/11/2016 21:12, Yan Zhou wrote:
>
> Can you elaborate on JSONP?
>>
> > Would app. B now have to know user's password?
>
> No need.
> JSONP is pre-CORS. It has some limitations compared to Ajax, but some
> useful possibilities, like auto CAS login.
> Here is an example of adding auto login in angularJS:
> https://github.com/prigaux/angular-seed/commit/4d51d23280eb9
> 59a3d1773b2fcc69c4cf50ccd88
>
> By the way, another simpler solution is to allow restricted redirect after
> login in app B.
> Make the user go to:
> - https://b/login?redirect=https://a/
>   which redirects to (normal CAS login)
> - https://cas/login?service= https://b/login?redirect=https://a/
>   which redirects to
> - https://b/login?redirect=https://a/&ticket=xxxx
>   => set-cookie of application b
>   which redirects to
> - https://a
>   this app can do AJAX request https://b/rest
>   => works since cookie of app B
>
> cu
>
> --
> - CAS gitter chatroom: https://gitter.im/apereo/cas
> - CAS mailing list guidelines: https://apereo.github.io/cas/M
> ailing-Lists.html
> - CAS documentation website: https://apereo.github.io/cas
> - CAS project website: https://github.com/apereo/cas
> --- 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 view this discussion on the web visit https://groups.google.com/a/ap
> ereo.org/d/msgid/cas-user/9fb6de0f-4362-e621-cad3-ba50c19a22
> 77%40univ-paris1.fr.
>

-- 
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
--- 
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 view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAFSoZemQzePzJE861k%3DDN3VTOXF-BHg0Y2epCDsbJTVS5AJtTQ%40mail.gmail.com.

Reply via email to