bug: Continuwuity server doesn't authenticate Cubitrix client #2536

Closed
opened 2026-11-15 17:12:12 +00:00 by damv · 2 comments

What is the bug?

Not exactly a bug to be honest, but rather an interoperability issue.

I created a PR to fix this issue: !2535

Cubitrix sends the redirect URI with a specified port to /_continuwuity/oauth2/client/register.

Today, the OAuth logic explicitly rejects URIs with ports, as in src/service/oauth/client_metadata.rs#L94

if uri.port().is_some() {
	return Err("HTTP redirect URIs for native applications do not need to \
	            specify a port. All ports will be accepted during \
	            authorization.");
}

I understand the actual port is specified later during the login() authorization request, which follows the specs. However, rejecting the URI entirely causes client registration to fail, which isn't a great user experience.

Would it make sense to simply strip the port during registration instead of returning an error? This would preserve the existing behavior while improving compatibility with clients that include an explicit port.

For reference, the same Cubitrix login flow works fine when using matrix.org as the homeserver.

Steps to reproduce

  1. Install Cubitrix
  2. Try to login to a Continuwuity homeserver
  3. This error pops up
    image

Server name and version

continuwuity 26.9.1 (046074b)

Additional context

No response

### What is the bug? Not exactly a bug to be honest, but rather an interoperability issue. I created a PR to fix this issue: !2535 [Cubitrix](https://git.radunenu.com/radu/cubitrix) sends the `redirect URI` with a specified port to `/_continuwuity/oauth2/client/register`. Today, the OAuth logic explicitly rejects URIs with ports, as in `src/service/oauth/client_metadata.rs#L94` ```rust if uri.port().is_some() { return Err("HTTP redirect URIs for native applications do not need to \ specify a port. All ports will be accepted during \ authorization."); } ``` I understand the actual port is specified later during the `login()` authorization request, which follows the specs. However, rejecting the URI entirely causes client registration to fail, which isn't a great user experience. Would it make sense to simply strip the port during registration instead of returning an error? This would preserve the existing behavior while improving compatibility with clients that include an explicit port. For reference, the same Cubitrix login flow works fine when using `matrix.org` as the homeserver. ### Steps to reproduce 1. Install [Cubitrix](https://git.radunenu.com/radu/cubitrix) 2. Try to login to a Continuwuity homeserver 3. This error pops up ![image](/attachments/df88db64-4903-4475-81b7-0cd2a38424cd) ### Server name and version continuwuity 26.9.1 (046074b) ### Additional context _No response_
Owner

This sounds like a client issue to me, and should be fixed by the client.

This sounds like a client issue to me, and should be fixed by the client.
Owner

This is a problem with the Cubitrix client. Continuwuity implements OAuth metadata validation as described in the Matrix specification.

This is a problem with the Cubitrix client. Continuwuity implements OAuth metadata validation as described in the Matrix specification.
Sign in to join this conversation.
No milestone
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
continuwuation/continuwuity#2536
No description provided.