Skip to content

Conversation

@cbbayburt
Copy link
Contributor

@cbbayburt cbbayburt commented Oct 28, 2025

Extracts the JWT token from the requests, logs into Uyuni server using the token instead of user/pass. The token auth uses the new /manager/api/oicdLogin endpoint. The rest of the flow is done using the usual session key from Uyuni.

Notes:

  • oicdLogin endpoint will be introduced in MLM 5.1.2 (expected early 2026)
  • The server falls back to the usual user/pass auth with env vars if UYUNI_AUTH_SERVER is not configured.
  • user/pass auth is still used when the MCP server is run in STDIO mode.

Related PR in the Uyuni repo: uyuni-project/uyuni#11084

Fixes https://github.com/SUSE/spacewalk/issues/28483

@cbbayburt cbbayburt marked this pull request as ready for review December 9, 2025 14:56
Copy link
Contributor

@ycedres ycedres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Contributor

@jordimassaguerpla jordimassaguerpla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that we cannot have oauth in mcp if oauth is not in mlm?

Do I understand correctly that, prior to this PR, we can have oauth in mcp but not in mlm?

If I understand correctly, this is a regression and will "break" what we had until mlm oauth support is released.

If that is the case, could we somehow make it backward compatible and not break/create a regression? Maybe some env variable to control the mlm authentication?

@jordimassaguerpla
Copy link
Contributor

As discussed in the slack, it is a security design decision to only support oauth if oauth is supported in mlm. Thus, forget my previous comments.

fastmcp_ctx = ctx.fastmcp_context
auth_header = fastmcp_ctx.request_context.request.headers['authorization']
token = None
if auth_header:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we add a config variable that controls if auth is expected for mlm? Could be we have a token for the mcp authorization but mlm does not yet support it..

@cbbayburt cbbayburt merged commit 5e3e199 into main Dec 11, 2025
@cbbayburt cbbayburt deleted the oauth-mlm branch December 11, 2025 13:04
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.

4 participants