This image implements a GitHub OAuth 2.0 authorization code flow server designed for popup-based authentication in web applications. It provides two main endpoints:
GET /auth: Initiates the OAuth flow by redirecting to GitHub's authorization URL with appropriate query parameters and state management for CSRF protection.GET /auth/github/callback: Handles the callback from GitHub after user authorization, verifies the state, exchanges the authorization code for an access token, and returns a client-compatible response via HTML postMessage.docker pull 0x1115/github-oauth:latest
docker run -d --name github-oauth \
-e CLIENT_ID="your-github-client-id" \
-e CLIENT_SECRET="your-github-client-secret" \
-e DOMAIN_NAME="https://your-domain.com" \
-p 8080:8080 \
0x1115/github-oauth:latest
http://localhost:8080. Integrate the /auth endpoint into your web application to start the OAuth flow.The server is configured via environment variables:
CLIENT_ID: GitHub OAuth Application Client ID (required)CLIENT_SECRET: GitHub OAuth Application Client Secret (required)DOMAIN_NAME: Fully qualified domain where this server is deployed (required)STATE_SIGNING_SECRET: Secret for HMAC signing OAuth state values (optional, defaults to CLIENT_SECRET)OAUTH_SCOPE: Comma-separated GitHub OAuth scopes (optional, default: user:email)OAUTH_CALLBACK_PATH: Callback endpoint path (optional, default: /auth/github/callback)OAUTH_MESSAGE_TYPE: postMessage event type sent to opener window (optional, default: authorization:github)POST_MESSAGE_TARGET_ORIGIN: Target origin used in window.opener.postMessage() (optional, default: *)STATE_TTL_SECONDS: Time-to-live for OAuth state in signed cookie (optional, default: 600 seconds)The server includes comprehensive unit tests covering all critical functionality, including:
If you want to discuss the design, implementation, or have any questions, please contact the maintainers at [email protected].
Content type
Image
Digest
sha256:5c94b7178…
Size
22.1 MB
Last updated
5 months ago
docker pull 0x1115/github-oauth