This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-15
Channels
- # adventofcode (2)
- # announcements (11)
- # babashka (48)
- # beginners (332)
- # calva (73)
- # cider (2)
- # clj-kondo (11)
- # cljfx (15)
- # clojure (23)
- # clojure-austin (1)
- # clojure-europe (42)
- # clojure-france (3)
- # clojure-nl (5)
- # clojure-taiwan (1)
- # clojure-uk (44)
- # clojurescript (25)
- # conjure (30)
- # cursive (3)
- # data-science (1)
- # fulcro (12)
- # jobs (3)
- # kaocha (1)
- # malli (2)
- # off-topic (49)
- # pathom (21)
- # pedestal (13)
- # re-frame (3)
- # reitit (1)
- # remote-jobs (1)
- # shadow-cljs (3)
- # sql (11)
- # startup-in-a-month (4)
- # tools-deps (113)
- # xtdb (16)
- # yada (6)
I’m looking into PAC4J as a possible authentication solution for our pedestal app. It claims: > Available for most frameworks/tools (implementations): > https://github.com/pac4j/spring-webmvc-pac4j • https://github.com/pac4j/j2e-pac4j • https://github.com/pac4j/pac4j-springboot • https://github.com/bujiio/buji-pac4j • https://github.com/pac4j/spring-security-pac4j • https://github.com/pac4j/play-pac4j • https://github.com/pac4j/vertx-pac4j > https://github.com/pac4j/spark-pac4j • https://github.com/pac4j/javalin-pac4j • http://ratpack.io/manual/current/pac4j.html#pac4j • http://www.pippo.ro/doc/security.html#pac4j-integration • https://github.com/pac4j/undertow-pac4j • http://jooby.org/doc/pac4j > https://apereo.github.io/cas/6.2.x/integration/Delegate-Authentication.html • https://github.com/pac4j/jax-rs-pac4j • https://github.com/pac4j/dropwizard-pac4j • https://github.com/pac4j/lagom-pac4j • https://github.com/StackVista/akka-http-pac4j • http://knox.apache.org/books/knox-1-1-0/user-guide.html#Pac4j+Provider+-+CAS+/+OAuth+/+SAML+/+OpenID+Connect
@orestis I imagine you could use the Undertow adapter with pedestal’s :context-configurator
option
We already use Undertow through immutant 🙂 immutant.web/run
can take an Undertow handler. But I’m not sure how you would then get the authenticated user from the pedestal request context
@orestis I’m not familiar with pac4j but I suspect that the jee-pac4j would work. Based on the https://github.com/pac4j/jee-pac4j/wiki/Get-the-authenticated-user-profiles, you can get the authenticated user profile info of the servlet request which will be available in Pedestal’s Context Map. I’ve not gone through the pac4j docs in detail though so can’t say for certain.
Thanks @ddeaguiar - I guess then my question is how do I get hold of the servlet so I can bolt other things in top of it?
Although after looking deeper into pac4j I think it would make more sense to make a ring adapter or something similar so it can be made into something that integrates with the pedestals router
You can add servlet filters through a function specified in the :context-configurator
container option. We have a https://github.com/pedestal/pedestal/blob/master/samples/servlet-filters-gzip/src/gzip/service.clj#L61-L71 that demonstrates this.