docker-hackmd
docker-hackmd copied to clipboard
Enabling auth via Google, Twitter, GH, etc...
When running the docker setup locally, options to log in via external identity providers do not show up, only email sign-up is offered. Does CodiMD support external identity providers? Do I need to set a certain environment variable?
Yes you have to set environment variables, see here https://github.com/hackmdio/codimd#environment-variables-will-overwrite-other-server-configs
CMD_FACEBOOK_* CMD_GOOGLE_* CMD_TWITTER_* etc.
Add those to the section where HMD_DB_URL is set.
Also check out our guides about enabling authentication:
https://github.com/hackmdio/codimd/tree/master/docs/guides/auth
Thank you, I was able to set this up with a Google Client ID and Client Secret on a production CodiMD server.
However, after confirming login on Google the /auth/google/callback results in a 500 server error. I was wondering how I could examine a relevant log in production. Can you help?
Check the URL parameter. Usually it's something with the return url because CMD_DOMAIN
is not set correctly.
These parameters seem to be correct, I was able to get the GitHub auth working easily with SSL and the right port.
The GET request causing the issue calls the URL:
https://example.com/auth/google/callback?code=4/XXXXXXXXXXXX#
It is caused by a forward from Google and ends with a hashmark.