Posts tagged 'url'

Adding a return URL during logout with CAS

CAS (Central Authentication Service) is a single-sign-on service (say that several times quickly) and through accessing a CAS /logout URL, as an application, you’re able to log the given user out.  What wasn’t clear (by Googling) was whether there’s a possibility to redirect the user back to the original application (or a given URL).  I now know, thanks to the CAS Protocol Documentation (section 2.3), that any posts that mention adding ?service=http://my.url/ to the /logout URL are incorrect, as this isn’t a valid parameter (at least not at time of writing).

However …

Plone: URL Encoding In A Script

So, for today’s problem, how can we get a URL (specifically the GET request arguments) suitably encoded? Easy, if we’re talking about a Python script that lives on the file system and can be used within Zope/Plone that way. But what about some sort of Python script that has to exist on the Plone site (specifically, creating a PloneFormGen (PFG) Custom Adapter)?

First thing I jumped to is urllib and urlecode: but no luck because you’re unauthorised to import the library in your script. Boo!

After much poking, and Googling for something that I thought should …