Skip to content

Tchap: forbidden login when redirect involves localhost #98

@tobiasBora

Description

@tobiasBora

English translation below

J’essaie de me connecter à Tchap via l’excellent client de bureau FluffyChat (le client Android fonctionne très bien pour des raisons que je n’arrive pas à expliquer), car il propose la prise en charge de plusieurs comptes (j’ai aussi besoin d’utiliser mon compte sur matrix.org). Malheureusement, lorsque j’essaie de me connecter, FluffyChat me redirige vers https://matrix.agent.education.tchap.gouv.fr/_matrix/client/v3/login/sso/redirect?redirectUrl=http%3A%2F%2Flocalhost%3A3001%2F%2Flogin et cette page affiche une erreur :

Erreur 403
Forbidden
matrix.agent.education.tchap.gouv.fr
Image

Fait intéressant, si j’utilise une URL de redirection différente comme
https://matrix.agent.education.tchap.gouv.fr/_matrix/client/v3/login/sso/redirect?redirectUrl=http%3A%2F%2Flocalhost%3A3001%2F%2Flogi,
je n’obtiens aucune erreur… Mais çe ne me permet pas de me connecter sur FluffyChat évidemment car il utilise localhost, j’imagine parce qu’il s’agit d’un serveur web local lancé par FluffyChat pour poursuivre le processus de connection.

Pourriez-vous enlever cette limitation svp?

English

I'm trying to log in to tchap via the great FluffyChat desktop client (android client works fine for some reasons I can't explain) since it provides multi-account support (I also need to use my account on matrix.org). Sadly, when I try to connect, FluffyChat redirects me to https://matrix.agent.education.tchap.gouv.fr/_matrix/client/v3/login/sso/redirect?redirectUrl=http%3A%2F%2Flocalhost%3A3001%2F%2Flogin and this page prints an error:

Erreur 403
Forbidden
matrix.agent.education.tchap.gouv.fr
Image

Interestingly if I use a different redirect URL like https://matrix.agent.education.tchap.gouv.fr/_matrix/client/v3/login/sso/redirect?redirectUrl=http%3A%2F%2Ffoo.org%3A3001%2F%2Flogin I get no error… But FluffyChat uses localhost, I guess since it is a local web server ran by FluffyChat that continues.

Could you please remove this limitation?

EDIT

I found a really dirty workaround: I manually edited the URL by replacing URL with a dummy redirect url (I used my URL-encoded IPV6 but I guess you can put anything actually). At the end after the connection I was provided a button Continue. Using firefox devtools (F12) I inspected this button and realized that it was pointing to an url like http://mydummyurl:3001/login?loginToken=sometoken, so I manually copy/pasted this url, replacing the dummy url with localhost, and now it works! But definitely not super practical…

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions