okay I am totally lost. I have from Google
clientId:"<http://xxxapps.googleusercontent.com|xxxapps.googleusercontent.com>"
code:"yyy"
redirectUri:"<http://something/auth/google>"
state:"zzzz"
what do I do with it now?Pro tip, yada has oauth support (which probably works with Google)
yeah the documents are a bit sparse in that area š
https://github.com/juxt/yada/blob/master/ext/oauth2/src/yada/oauth.clj
A little bit of reading the source, you set the authentication scheme to oauth, and the options are specified in that function (kinda)
There's even an Google oauth 2 callback resource for use
yeah, I'm really feeling this is much simpler than I am making it out to be. I'm sure I am over thinking it.
["/auth/google" (yada/as-resource oauth/oauth2-callback-resource-google)]
?
The Google resource is a function which returns a resorted
Resource
["/auth/google" (oauth/oauth2-callback-resource-google :response)]
?
It needs these options in a map: :access-token-url s/Str :client-id s/Str :client-secret s/Str :secret s/Str :redirect-uri s/Keyword ;; The function that will ultimately call the third-party API for user-details. ;; First argument is the access-token :handler (s/=> {s/Any s/Any} {:access-token s/Str :openid-claims {s/Str s/Str}})
I'm trying to get header parameters to work with yada. One thing is that they seem to be case insensitive. The other is that if I declare a header parameter such as
{:parameters {:header {:foo String}}}
Then no matter if I provide foo or not I get various error messages saying that it is missing. Perhaps I'm doing something wrong. This makes no difference either.
{:parameters {:header {"foo" String}}}
the error is a variation of
{:status 400,
:errors ([:header {:error {:foo missing-required-key}}])}
and
More than one non-optional/required key schemata: ["foo" java.lang.String]
this is not covered in detail in the docs
@macroz this caught me too
what you need is
{:header {(schema/required-key "x-orig-url") String}}
@danielcompton thanks a million!
np, happy to help
Is the best practice to match both /foos
and /foos/
to use #{"" "/"}
that seems like a very common thing to have to do and it clutters my routes a bit
Iām trying out our yada app on clojure 1.9.0-beta1. I get an exception on aleph/http/multipart.clj line 30
@borkdude thanks for reporting
Upgrading aleph to the newest stable solves it