CAS 5.x - regular expressions

33 views
Skip to first unread message

Jeffrey Ramsay

unread,
Dec 27, 2017, 8:45:41 AM12/27/17
to CAS Community
All -

I went live with CAS 5.1.7 in production and ran into a problem that was not reported in test. I have a site which requires me to use both star and dot star allowances so, I defined two service entries however, I think I should be able to combine these but have not been successful.

How can I combine these links? (.|.*) did not work and I'm not sure what effect escaping the dots will have. Since this is production, I can experiment as much as I would like.

https?://my.service.edu/*

https?://my.service.edu/.*

Thanks,
-Jeff

Andy Ng

unread,
Jan 2, 2018, 2:09:35 AM1/2/18
to CAS Community
Hi Jeff,

Would like to know what exactly you want to catch using regex for the two links?  (Maybe give some example?) 

The first link you provided, when translate to regex only matches something like these:
https://my.service.eduhttp://my.service.edu///////////////////////////////////

Which, I think maybe is not what you wanted.


In any case, If your two links are valid, see if the below fit your needs:

Or maybe even this:
https?://my.service.edu((/.*)|(/*))


If you want to test Regex (the links pattern you using) without worrying it will broke your production setup, you can always go to site like http://jsregex.com/, then fine tune your link pattern until it is correct before deploying them to production.

cheers
- Andy

Jeffrey Ramsay

unread,
Jan 2, 2018, 7:15:30 AM1/2/18
to cas-...@apereo.org

Andy,

 

Thanks for the update and after using the validation link you provided, I believe the following will work for both service links.

 

^https?://my.service.edu.*$

 

Thanks,

-Jeff

 

Sent from Mail for Windows 10

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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/78814056-a9fa-4537-8ec5-9d59f5f74b62%40apereo.org.

 

Ray Bon

unread,
Jan 2, 2018, 12:44:52 PM1/2/18
to cas-...@apereo.org
Jeff,

I would suggest you include the trailing slash as optional to avoid someone poking at your system with a service like https://my.service.education

^https?://my.service.edu(/?|/.*)$

Ray
-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

Jeffrey Ramsay

unread,
Jan 2, 2018, 8:56:17 PM1/2/18
to CAS Community
Good point.

Thanks,
-Jeff

To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.

-- 
Ray Bon
Programmer analyst
Development Services, University Systems
2507218831 | CLE 019 | rb...@uvic.ca

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/1514915084.4183.14.camel%40uvic.ca.

Reply all
Reply to author
Forward
0 new messages