CAS drops named anchors

27 views
Skip to first unread message

Dusty Edenfield

unread,
Aug 21, 2017, 9:33:15 AM8/21/17
to CAS Community
Is there any solution for when CAS drops named anchors upon login redirect?

Example:
It appears (from LiveHTTPHeaders and HTTPFox traces) that CAS is dropping named anchors from target URLs. For example, going to the CAS-protected URL:

   https://somesite.edu/reports/#Mobile

results, after authentication, the browser ending up at:

   https://somesite.edu/reports/

...sans the named link reference. This is a problem in multiple browsers, and I don't know if this is a bug in CAS, or a bug in our implementation of CAS.


Andy Ng

unread,
Aug 22, 2017, 5:04:41 AM8/22/17
to CAS Community
I am not using the name anchor in my use case, but after some testing:

I think that saving the named anchor is not a feature that is implemented for all login methods for CAS. For example, in my website: normal login (username & password) will preserve the name anchor (I have checked that both Firefox and Chrome works), while using pac4j delegated login will completely drop my named anchor.

Don't know whether there is an setting in cas properties that will enable saving the name anchor, I doubt it. If I were you I might try just using some javascript tricks to save the anchor value to an localStorage or something before login, and resume it to the user when they land the login page for the second time.

-Andy

Andrew Morgan

unread,
Aug 22, 2017, 12:28:09 PM8/22/17
to CAS Community
Fragments (named anchors) are not sent to the server. Search your web
server access logs - you won't see a "#" in them. :)

You can read a bit about it here:

http://codetunnel.io/how-to-persist-url-hash-fragments-across-a-login-redirect/

Andy
> --
> - 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+u...@apereo.org.
> To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/35ebbc34-d73a-4e3a-b1ff-32b4d25816b3%40apereo.org.
>

Misagh Moayyed

unread,
Aug 22, 2017, 12:33:36 PM8/22/17
to cas-...@apereo.org

Dusty Edenfield

unread,
Aug 22, 2017, 2:49:22 PM8/22/17
to cas-...@apereo.org
Thanks all for the replies.  Very helpful.  Misagh, this information helps a lot and we're looking to upgrade to CAS 5 soon so we may try this out.

Reply all
Reply to author
Forward
0 new messages