Refactored sso logout url.

The sso logout url is now in a separate function.
This way a rest api can serve the url.