This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-13
Channels
- # atlanta-clojurians (1)
- # beginners (148)
- # boot (13)
- # capetown (1)
- # cider (38)
- # cljs-dev (92)
- # clojure (61)
- # clojure-brasil (1)
- # clojure-dev (6)
- # clojure-italy (21)
- # clojure-losangeles (1)
- # clojure-nl (7)
- # clojure-norway (20)
- # clojure-spec (70)
- # clojure-uk (64)
- # clojurescript (69)
- # core-async (11)
- # cursive (6)
- # data-science (2)
- # datomic (50)
- # docker (2)
- # duct (12)
- # figwheel (1)
- # fulcro (81)
- # graphql (19)
- # jobs (3)
- # jobs-discuss (44)
- # keechma (1)
- # leiningen (1)
- # mount (2)
- # off-topic (10)
- # onyx (19)
- # parinfer (3)
- # portkey (6)
- # re-frame (4)
- # reagent (145)
- # reitit (1)
- # ring (1)
- # ring-swagger (2)
- # specter (1)
- # sql (4)
- # tools-deps (43)
- # unrepl (29)
- # vim (1)
Hello, has anyone managed to authenticate over websockets in order to have authenticated subscriptions? I am using lacinia-pedestal
, as far as I see something like this is not supported (yet)? https://www.apollographql.com/docs/graphql-subscriptions/authentication.html
@jerben we are using cookies to authenticate, we use the init-context argument to get the cookie off the upgrade request and decide whether to allow the upgrade to go ahead
@jerben I did it sometime, but in this case you first had to login on a page, then the username would be stored in the session, and only with a user with certain roles the websocket was initiated
Iām trying to add auth to lacinia-pedestal setup, I basically just put and auth interceptor in the service map (-> (lacinia/service-map ...) ... (assoc ::pedestal/interceptors [(auth/check-auth auth)]) (pedestal/create-server))
.
Is this the right way of doing things? Iām getting non descriptive {:msg "sending error", :message "Internal server error: no response", :line 214}
error when the auth succeeds
That looks like you replaced the interceptors provided by Lacinia with just your auth interceptor.
Start with http://walmartlabs.github.io/lacinia-pedestal/com.walmartlabs.lacinia.pedestal.html#var-service-map ā :interceptors option http://walmartlabs.github.io/lacinia-pedestal/com.walmartlabs.lacinia.pedestal.html#var-default-interceptors http://walmartlabs.github.io/lacinia-pedestal/com.walmartlabs.lacinia.pedestal.html#var-inject
Or maybe let me rephrase: How do I add an interceptor in front of all lacinia-pedestal routes and not break anything?
@nooga Regarding queries/mutations, we currently read an auth token from the context
in the resolver function and resolve accordingly.
I just discovered that field names in lacinia have to be simple keywords, no namespaces allowed. Anyone know whether that's ultimately a limitation of GQL, or if it's just lacinia?