Skip to content
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

Migrate from mas-oidc (adding wasm support to sdk-ffi crate) #4593

Open
ospfranco opened this issue Jan 29, 2025 · 5 comments
Open

Migrate from mas-oidc (adding wasm support to sdk-ffi crate) #4593

ospfranco opened this issue Jan 29, 2025 · 5 comments

Comments

@ospfranco
Copy link

Part of the ongoing effort to add support for WASM to the matrix SDK is adding WASM support to each of the crates/bindings. Several of the crates already have been modified and add support for WASM compilation. One of the final crates that needs modification is the bindings/matrix-sdk-ffi crate.

I've done some preliminary work (in my fork), however, at some point got stuck because the crate depends on mas-oidc-client (sub dependency of using experimental-oidc) for the open ID authentication. Not only that it is stuck on 0.11.0 version of the crate, the crate itself using multi-threaded code and crates which make it impossible to add support for a WASM target. I asked the maintaners of the crate and they said that it was too much to keep the crate both a generic openID crate and a next-gen auth for building matrix clients was too much. Moreover, the license has been changed to AGPL-3.0 which means further versions than 0.11.0 can no longer be used on the matrix-sdk.

As such, the intention is to replace the usage of mas-oidc-client with a license compatible and wasm compatible implementation, that being a hand-written one or another compatible crate.

@poljar
Copy link
Contributor

poljar commented Jan 29, 2025

Due to mas-oidc-client not supporting everything we need, we're already using the openidconnect crate in some places.

We would probably just migrate fully to it. (Unless I misunderstood what those crates are about and they aren't interchangeable).

@ospfranco
Copy link
Author

They probably do the same :)

@zecakeh
Copy link
Collaborator

zecakeh commented Jan 30, 2025

The MSCs have migrated away from OpenID Connect to more basic OAuth 2.0. Since OpenID Connect adds things on top , I am afraid that their API will fail on servers that are not compliant with OIDC but that are compliant with the MSCs.

My thoughts were to use oauth2 instead of openidconnect, that is from the same developer so that has a very similar API. The only thing is that it doesn't support server metadata discovery and client registration, but it shouldn't be too hard to add. See also the discussion in #4550.

I don't know if you are planning to do this and when, but I was planning to work on this next month if that helps 🙂 .

@ospfranco
Copy link
Author

I think we will leave you tackle this one @zecakeh, you seem to know better what you are doing. I'm moving to implementing some other missing modules from the wasm implementation. Should I close this ticket or do you want to keep this open?

@zecakeh
Copy link
Collaborator

zecakeh commented Jan 30, 2025

Let's leave this open to keep track of the progress.

@jplatte jplatte changed the title MIgrate from mas-oidc (adding wasm support to sdk-ffi crate) Migrate from mas-oidc (adding wasm support to sdk-ffi crate) Jan 30, 2025
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

No branches or pull requests

3 participants