Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Enabling auth via Google, Twitter, GH, etc... #66

Open
despens opened this issue Sep 5, 2018 · 5 comments
Open

Enabling auth via Google, Twitter, GH, etc... #66

despens opened this issue Sep 5, 2018 · 5 comments
Labels

Comments

@despens
Copy link

despens commented Sep 5, 2018

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?

@dampfklon
Copy link

dampfklon commented Sep 5, 2018

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.

@SISheogorath
Copy link

Also check out our guides about enabling authentication:

https://github.com/hackmdio/codimd/tree/master/docs/guides/auth

@despens
Copy link
Author

despens commented Sep 8, 2018

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?

@SISheogorath
Copy link

Check the URL parameter. Usually it's something with the return url because CMD_DOMAIN is not set correctly.

@despens
Copy link
Author

despens commented Sep 8, 2018

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants