10000 Add: OAuth for GMCP Extension for MUD Client Authentication by mpconley · Pull Request #7784 · Mudlet/Mudlet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add: OAuth for GMCP Extension for MUD Client Authentication #7784

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

mpconley
Copy link
Contributor

Brief overview of PR changes/additions

Support Open ID Connect (OIDC) providers to authenticate users to games.

For the purpose of this PR, StickMUD will serve as the pilot.

  1. User connects to StickMUD, initiating authentication.
  2. StickMUD sends Char.Login.Default, providing an authentication location (OIDC URL).
  3. Mudlet opens the browser with the provided location for user login.
  4. User logs in through the OIDC provider (Google, Microsoft, etc.).
  5. OIDC Provider redirects to Mudlet’s local server with an authorization_code.
  6. Mudlet captures the authorization_code and sends it to StickMUD via Char.Login.AuthCode.
  7. StickMUD executes a Python script to exchange the code for an ID token.
  8. StickMUD verifies the token and confirms authentication via Char.Login.Result.
  9. Mudlet receives confirmation and informs the user of success/failure.
sequenceDiagram
    participant User
    participant Mudlet (GMCPAuthenticator)
    participant Browser
    participant OIDC Provider
    participant StickMUD (Game Server)
    participant Python OIDC Script

    User->>StickMUD (Game Server): Connects to game
    StickMUD (Game Server)->>Mudlet (GMCPAuthenticator): Sends `Char.Login.Default` with `location`
    Mudlet (GMCPAuthenticator)->>Browser: Opens authentication URL from `location`
    Browser->>OIDC Provider: User logs in & approves authentication
    OIDC Provider->>Mudlet (Local Server): Redirects with `authorization_code`
    Mudlet (GMCPAuthenticator)->>StickMUD (Game Server): Sends `authorization_code` via `Char.Login.AuthCode`
    StickMUD (Game Server)->>Python OIDC Script: Exchanges `authorization_code` for ID token
    Python OIDC Script->>StickMUD (Game Server): Returns ID token
    StickMUD (Game Server)->>Mudlet (GMCPAuthenticator): Sends GMCP authentication result (`Char.Login.Result`)
    Mudlet (GMCPAuthenticator)->>User: Displays success message
Loading

🔹 Why This Works Well

GMCP Authentication Extension Compliant → Uses Char.Login.Default, Char.Login.AuthCode, and Char.Login.Result.
RFC 8252 & 7636 Compliant → Uses browser-based authentication with PKCE.
Security Best Practices → Game handles client_secret and token validation.
Simplifies Mudlet's Role → Mudlet only handles browser interaction and GMCP messaging.

Motivation for adding to Mudlet

Extending the GMCP Extension for MUD Client Authentication to support the "oauth" type.

Other info (issues closed, discussion etc)

This code may be in draft and may not run yet. I had a working version that was not compliant with the RFCs, and now I am refactoring.

We may add buttons with the major providers to Mudlet in time where it will suggest the provider to the game like many enterprise applications do. They could either be part of default games profiles, or sent from the game and used on future connections. It needs a lot of thought. For now, we're trying to stay as close to the proposed GMCP Authentication Extension and the RFC 8252 & 7636 to keep it simple.

@add-deployment-links
Copy link
add-deployment-links bot commented Mar 17, 2025

Hey there! Thanks for helping Mudlet improve. 🌟

Test versions

You can directly test the changes here:

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

Successfully merging this pull request may close these issues.

2 participants
0