Open cupcakearmy opened 2 years ago
Odd! I just copy pasted your example (including the ***
), and I'm not seeing that error on startup 🤔
Could there be a discrepancy in how those env vars are loaded into Docker? One thing I noticed is that the env vars don't use quotes, except for the AUTH ones, maybe that doesn't fly with Docker's way of loading in the .env file?
(@danilopolani this is exactly the sort of config gotcha that prevents us from doing cool things like in your PR 😄 )
Took me a good 30 min but I got it:
Turn out Slack Client IDs are a long string of digits and have a .
inside. (e.g. xxxxxxxxxxxxxx.xxxxxxxxxxxxxxxx)
Having a dot inside of the client id causes the break. Why?
Well what happens is that here directus thinks it's a number because of the isNan
function and casts it to a number. Now since the leading number is quite big, decimal places are lost, altering the value. I guess from then the openid-client library only accepts a string and not a number
So I don't know how much numbers are required in the config file, so can't tell if this is a required feature, however makes oauth/openid not usable with slack.
Yeah, it's the same for Facebook Client ID.
You should be able to force cast it to a string by using AUTH_SLACK_CLIENT_ID="string:xxx.xxx.xxx"
We'll leave this open, as I agree we should probably not cast things to numbers by default, and instead rely on a hardcoded list of env vars that we expect to be numbers 👍🏻
Can confirm that with `"string:..." it works. Maybe a small "watch out" section in the docs would be helpfull :) Thanks for the quick replies as always ❤️
Linear: ENG-287
I just ran into this issue with facebook OAuth login. They use all numbers for their CLIENT_ID which was giving me an error:
TypeError: client_id is required
I'm using Directus 10.3.0
Preflight Checklist
Describe the Bug
I'm trying to get openid to work but no luck.
I've tested the OpenID flow with https://openidconnect.net/ and it works.
What is interesting, looking at the code
It should be an error before if
clientId
would not be defined hereHowever the error comes from the
openid-client
library. Am I missing something? Thanks & I hope it's not a duplicate, could not find anythingTo Reproduce
Get the latest release
v9.0.0
and try slack oauth or openidErrors Shown
Stacktrace:
What version of Directus are you using?
v9.0.0
What version of Node.js are you using?
The one in the official docker image
What database are you using?
postgres:14-alpine
What browser are you using?
FF
What operating system are you using?
macOS
How are you deploying Directus?
Docker