Skip to content

feat: integrate Element with Synapse REST auth provider#1

Open
liviaUeno wants to merge 1 commit into
developfrom
feat-rest-auth-provider
Open

feat: integrate Element with Synapse REST auth provider#1
liviaUeno wants to merge 1 commit into
developfrom
feat-rest-auth-provider

Conversation

@liviaUeno

Copy link
Copy Markdown

REST Auth Provider for Matrix Synapse

This module implements a custom password authentication provider
for Matrix Synapse using an external REST API (paywall / authentication service).

  • authenticate users against an external service
  • automatically create Matrix users on first successful login
  • generate Matrix user IDs based on external user data

This module does not expose a registration endpoint.
User creation happens implicitly during login if the user does not exist.


Failed authentication

Authentication will fail if:

  • credentials are invalid (non-200 HTTP response), or
  • required fields (email, id) are missing or malformed
    In these cases, Synapse will reject the login attempt.

Matrix user creation

If authentication succeeds and the Matrix user does not exist:

  • the user is created automatically
  • the Matrix localpart is generated as follows:
    • first_last if both first and last name are present
    • otherwise, the email local part (before @)
  • the localpart is normalized to:
    • lowercase
    • ASCII characters only
    • non-alphanumeric characters replaced with _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant