pedestal

2020-04-01T21:25:48.009800Z

I am trying to hook pedestal up to auth0 authentication using their `

com.auth0/mvc-auth-commons {:mvn/version "1.2.0"}
client library, and it expects to use a SessionManager to store nonce, etc whilst awaiting the authentication to return Vanilla pedestal throws me a
Caused by: java.lang.IllegalStateException: No SessionManager
	at org.eclipse.jetty.server.Request.getSession(Request.java:1568)
Is there any received wisdom around Session Managers or Auth0 in Pedestal? should I just apply https://stackoverflow.com/questions/19718159/java-lang-illegalstateexception-no-sessionmanager and hope for the best?

2020-04-01T21:31:03.010Z

oh perhaps I'd better read https://www.eclipse.org/jetty/documentation/current/session-management.html

2020-04-01T22:39:16.010500Z

which is passing a (SessionHandler)null to the ServletContextHandler

2020-04-01T22:40:18.010700Z

but perhaps I get the chance to reshape that context a few lines further down at

(when context-configurator
  (context-configurator context))

2020-04-01T22:52:56.010900Z

I might be able to abuse the options

{:context-configurator
      (fn [^ServletContextHandler sch]
          (set! (.-_options sch) ServletContextHandler/SESSIONS)

2020-04-01T22:53:27.011100Z

although (set! (.-_options is looking a bit hacky...

2020-04-01T22:59:59.011300Z

:io.pedestal.http/container-options
{:context-configurator
 (fn [^ServletContextHandler sch]
     (.insertHandler sch (SessionHandler.))
seems to do the trick though