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

Integration with Django #17

Open
the-moog opened this issue Jan 24, 2020 · 3 comments
Open

Integration with Django #17

the-moog opened this issue Jan 24, 2020 · 3 comments

Comments

@the-moog
Copy link

the-moog commented Jan 24, 2020

I want to try an integrate ma1sd as a source of IDs from Django.
my auth_user table in django has
username, first_name, last_name, full_name, email in a view auth_fullnames
Database is currently sqlite, though it will soon become postgres.
Would this be correct for sqlite:

sql:
  enabled: true
  type: sqlite
  connection: /usr/lib/database/django
  directory:
    query:
      name:
        type: 'localpart'
        value: 'SELECT username, full_name FROM auth_fullnames WHERE full_name LIKE ?'
      threepid:
        type: 'localpart'
        value: 'SELECT username, full_name FROM auth_fullnames WHERE email LIKE ?'

Also:
1: If and how to use the Identity and Profile stanzas?
2: Possible to synchronise passwords using ma1sd between Django and Synapse?

For 2 I guess we use either the exec or REST backends, but the latter has limited examples.

@the-moog
Copy link
Author

the-moog commented Jan 27, 2020

I can answer my own question. YES
...BUT I can't get it to work. It searches (directory API) but if I allow MA1SD to capture the profile and/or identity APIs it breaks everything.

@the-moog
Copy link
Author

I still need assistance.
If the user is authenticated via EXEC and their Django user id, they can login but their email 3PID is still missing from their profile.
I don't understand how this is supposed to work?
Is it 1 or 2?
1: Matrix supposed to delegate profile lookups to MA1SD via a proxy config
2: MA1SD supposed to update the profile 3PID, etc on the matrix server during login?
As previously stated I tried sending _matrix/client/r0/profile to MA1SD and that really screws things up.
It appears the client uses _matrix/client/r0/account/3pid to access this information, should I be capturing that instead?

@the-moog
Copy link
Author

For reasons beyond me this is ALMOST working.
Latest Synapse/Element and ma1sd v2.4.0
The user ID and automatic account creation now works.
Though it breaks if the user already exists with the same email.

Only one fault. it does not update either the display name or email for the user
I've made Django update Synapse database with the displayname but it does not display. Am I updating the wrong table or is it cached some place?

Craeckie referenced this issue in Craeckie/ma1sd Apr 8, 2022
…anes.versions-0.40.0

Bump com.github.ben-manes.versions from 0.39.0 to 0.40.0
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

1 participant