project-robius / robrix

A Matrix chat client written in pure Rust using the Makepad UI toolkit and the Robius app dev framework
MIT License
67 stars 11 forks source link

Login Screen Phase 2: support Single Sign On, OIDC #114

Open kevinaboos opened 3 weeks ago

kevinaboos commented 3 weeks ago

This depends on issue #113 and is a follow-up to that issue, which only describes setting up a basic login screen that supports username+password only.

Once a basic username+password login screen is working, we should add SSO login support such that users can login via third-party auth providers like a Google account, Facebook, GitHub, Twitter, Apple, etc.

Fortunately, the Matrix SDK provides many authentication APIs as part of the MatrixAuth type. You can access this type via the client.matrix_auth() function.

Here is the current login flow in the sliding_sync.rs file: https://github.com/project-robius/robrix/blob/106033de803df72e7242267c147792cdee8a8878/src/sliding_sync.rs#L79-L106 Note that the first step is querying which login types are supported by the server, which you can then iterate over and inspect using the LoginType enum.