Skip to content

Instantly share code, notes, and snippets.

@bjoern-r
Last active November 2, 2019 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoern-r/5def028edbae53cb1724099b84fdf54b to your computer and use it in GitHub Desktop.
Save bjoern-r/5def028edbae53cb1724099b84fdf54b to your computer and use it in GitHub Desktop.
CodiMD docker with Oauth2 via

CodeiMD authentication via Oauth2 with django-oidc-provider

install django-oidc-provider

create application in django-oidc-provider

Configure allowed callback urls:

https://pad.server.com/auth/oauth2/callback
http://pad.server.com/auth/oauth2/callback

Configure scopes:

openid profile email

configure codimd

add the following ENV vars to the docker-compose.yml

      - CMD_OAUTH2_BASEURL=https://auth.server.com
      - CMD_OAUTH2_USER_PROFILE_URL=https://auth.server.com/userinfo
      - CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR=nickname
      - CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR=given_name
      - CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR=email
      - CMD_OAUTH2_TOKEN_URL=https://auth.server.com/token
      - CMD_OAUTH2_AUTHORIZATION_URL=https://auth.server.com/authorize?scope=openid%20profile%20email
      - CMD_OAUTH2_CLIENT_ID=16xxxx
      - CMD_OAUTH2_CLIENT_SECRET=1eXXXXXXXXX8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment