Skip to main content

GitHub Authentication

PlatformWorks Hub supports login via GitHub using OAuth2.

This allows users to authenticate using their GitHub accounts. Only users from allowed GitHub organizations or with specific usernames can be permitted (custom logic may apply).


Required Environment Variables

VariableDescription
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_IDGitHub OAuth App Client ID
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_CLIENT_SECRETGitHub OAuth App Client Secret
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_SCOPETypically: read:user,user:email
SPRING_SECURITY_OAUTH2_CLIENT_REGISTRATION_OIDC_AUTHORIZATION_GRANT_TYPEUsually: authorization_code
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_AUTHORIZATION_URIGitHub authorize endpoint
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_TOKEN_URIGitHub token endpoint
SPRING_SECURITY_OAUTH2_CLIENT_PROVIDER_OIDC_USER_INFO_URIGitHub user info endpoint

Setup Instructions (GitHub OAuth App)

  1. Go to GitHub Developer Settings
  2. Under OAuth Apps, click New OAuth App
  3. Fill in the following:
    • Application name: e.g. Hub App
    • Homepage URL: https://your-domain.com
      (replace with your actual deployment domain)
    • Authorization callback URL:
      https://your-domain.com/login/oauth2/code/oidc
  4. After registration:
    • Copy the Client ID and Client Secret
  5. Set the logout URL (optional) in your frontend config:
    https://your-domain.com/logout