ma1uta / ma1sd

Federated Matrix Identity Server (formerly fork of kamax/mxisd)
GNU Affero General Public License v3.0
167 stars 56 forks source link

Issue with auth #59

Open the-moog opened 4 years ago

the-moog commented 4 years ago

Still trying to get this working.... When logging in with an email I see this in the log (emails and urls sanitised) Related to #18 (which is still causing me issues)

When a 3PID resolved in more than one backend, what should happen?

In this case UserName@mail.domain exists in both the Synapse and Sql databases. As they are different systems, it resolves to different MatrixIDs @UserName:matrix.mysite.org.uk and @UName:matrix.mysite.org.uk

But it tries to login to the wrong one, does not try the other. Accepts the password then glibly fails with 403 and no further explanation. I would expect it to create the non-existent MatrixID

[XNIO-1 task-5] INFO io.kamax.mxisd.auth.AuthManager - Proxy resolution: http://matrix.mysite.org.uk/_matrix/client/r0/login to http://localhost:8008/_matrix/client/r0/login
[XNIO-1 task-7] INFO io.kamax.mxisd.auth.AuthManager - Login request with medium 'email' and address 'UserName@mail.domain'
[XNIO-1 task-7] INFO io.kamax.mxisd.backend.sql.SqlThreePidProvider - SQL lookup
[XNIO-1 task-7] INFO io.kamax.mxisd.backend.sql.SqlThreePidProvider - SQL query: SELECT 'email' as medium, username as uid FROM auth_fullnames WHERE medium = ? and address = ?
[XNIO-1 task-7] INFO com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 2, acquireRetryAttempts -> 10,
  acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null,
  connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> oksi7pac97w6yb129aiab|42a0cc7d,
  debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> null, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false,
  forceSynchronousCheckins -> false, forceUseNamedDriverClass -> false, identityToken -> mksk7pac97w6yb765aiab|41a0bb7d, idleConnectionTestPeriod -> 0, initialPoolSize -> 3,
  jdbcUrl -> jdbc:sqlite:/opt/cambsac/cambsacdb, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 10,
  maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 1, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {},
  propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {},
  usesTraditionalReflectiveProxies -> false ]

[XNIO-1 task-7] INFO io.kamax.mxisd.backend.sql.SqlThreePidProvider - Found match: UserName
[XNIO-1 task-7] INFO io.kamax.mxisd.backend.sql.SqlThreePidProvider - Resolving as localpart
[XNIO-1 task-7] INFO io.kamax.mxisd.lookup.strategy.RecursivePriorityLookupStrategy - Found 3PID mapping: {medium: 'email', address: 'UserName@mail.domain', mxid: '@UserName:matrix.mysite.org.uk'}
[XNIO-1 task-7] INFO io.kamax.mxisd.auth.AuthManager - Proxy resolution: http://matrix.mysite.org.uk/_matrix/client/r0/login to http://localhost:8008/_matrix/client/r0/login
[XNIO-1 task-8] INFO io.kamax.mxisd.http.undertow.handler.auth.RestAuthHandler - Requested to check credentials for @UserName:matrix.mysite.org.uk
[XNIO-1 task-8] INFO io.kamax.mxisd.auth.AuthManager - Attempting authentication with store ExecAuthStore
[XNIO-1 task-8] INFO io.kamax.mxisd.backend.exec.ExecAuthStore - Performing authentication for @UserName:matrix.mysite.org.uk
[XNIO-1 task-8] INFO io.kamax.mxisd.backend.exec.ExecStore - Executing /etc/ma1sd/wagtail_auth.sh
[XNIO-1 task-8] INFO io.kamax.mxisd.auth.AuthManager - @UserName:matrix.mysite.org.uk was authenticated by ExecAuthStore, publishing 3PID mappings, if any
[XNIO-1 task-7] INFO io.kamax.mxisd.auth.AuthManager - http status = 403