Skip to content

Double slashes in AuthorizationManager URLs #397

@camfulton

Description

@camfulton

Describe the bug
AuthorizationManager.discover_metadata results in urls like: http://example.com//authorize as a result of the call to auth_base.set_path(""); which resolves URLs with a trailing slash which is then doubled authorization_endpoint: format!("{}/authorize", auth_base). This is probably also happening for the call to ./well-known/... as well but I haven't verified.

To Reproduce
Steps to reproduce the behavior:

        let mut oauth_state = OAuthState::new("https://example.com/mcp", None)
            .await
            .context("Failed to initialize oauth state machine")?;

        log::info!("created oauth state, trying to start auth...");
        oauth_state
            .start_authorization(
                &["mcp", "profile", "email"],
                "http://localhost:8080/callback",
            )
            .await
            .context("Failed to start authorization")?;

Expected behavior
I expect the OAuthState machine to have resolvable URLs

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions