byu-cas.core
add-query-params
(add-query-params url qparams)
adds-assertion-to-response
(adds-assertion-to-response resp assertion)
authentication-filter
(authentication-filter handler options)
Checks that the request is carrying CAS credentials (but does not validate them)
BYU-CAS-service
(BYU-CAS-service s)
Returns a function that returns s because functions are required
cas
(cas handler)(cas handler options)
create-redirect-url
(create-redirect-url req service remove-ticket? host-override)
dependency-filter
(dependency-filter handler)
dependency-string
(dependency-string wrapped)
is-logged-in?
(is-logged-in? req)
Takes a request and determines whether the requesting user is logged in or not.
logout-filter
(logout-filter handler)
logout-resp
(logout-resp)(logout-resp redirect-url)
Produces a response map that logs user out of the application (by ending the session) and CAS (by redirecting to the CAS logout endpoint). Optionally takes a redirect URL which CAS uses to redirect the user (again!) after logout. Redirect URL should be the *full* URL, including "https:"
pprints-mw
(pprints-mw handler)
set-timeout
(set-timeout duration resp)
Takes a number of minutes and a response. Sets a time in :session, after which user will be logged out.
ticket-validation-filter
(ticket-validation-filter handler options)
user-principal-filter
(user-principal-filter handler)
Takes username and cas-info from request, and moves them into :username and :cas-info keys in the top level of the request map (rather than being buried in :query-params or :session).
Validator
protocol
members
validate
(validate v ticket service)
validator-maker
(validator-maker)(validator-maker server)
wrap-cas
(wrap-cas & args)
Middleware that requires the user to authenticate with a CAS server.
Is dependent on wrap-params and wrap-session; the general call will look something like
(-> handler
(wrap-cas :timeout 120)
(wrap-session)
(wrap-params))
The users's username is added to the request map under the :username key.
Accepts the following options:
:enabled - when false, the middleware does nothing
:no-redirect? - if this predicate function returns true for a request, a
403 Forbidden response will be returned instead of a 302
Found redirect
:server - the target cas server
:timeout - takes a number representing the length (in minutes) of the timeout period. BYU recommends 120 (two hours), see README
:host-override - host to redirect to after CAS authentication (if nil, host is obtained from request header)