diff --git a/src/main/java/io/kamax/mxisd/auth/AuthManager.java b/src/main/java/io/kamax/mxisd/auth/AuthManager.java index 5404bde..7a62759 100644 --- a/src/main/java/io/kamax/mxisd/auth/AuthManager.java +++ b/src/main/java/io/kamax/mxisd/auth/AuthManager.java @@ -23,6 +23,7 @@ package io.kamax.mxisd.auth; import io.kamax.matrix.MatrixID; import io.kamax.matrix.ThreePid; import io.kamax.matrix._MatrixID; +import io.kamax.matrix._ThreePid; import io.kamax.mxisd.UserIdType; import io.kamax.mxisd.auth.provider.AuthenticatorProvider; import io.kamax.mxisd.auth.provider.BackendAuthResult; @@ -72,7 +73,7 @@ public class AuthManager { } UserAuthResult authResult = new UserAuthResult().success(result.getProfile().getDisplayName()); - for (ThreePid pid : result.getProfile().getThreePids()) { + for (_ThreePid pid : result.getProfile().getThreePids()) { authResult.withThreePid(pid.getMedium(), pid.getAddress()); } log.info("{} was authenticated by {}, publishing 3PID mappings, if any", id, provider.getClass().getSimpleName()); diff --git a/src/main/java/io/kamax/mxisd/auth/provider/BackendAuthResult.java b/src/main/java/io/kamax/mxisd/auth/provider/BackendAuthResult.java index a89566d..3002c50 100644 --- a/src/main/java/io/kamax/mxisd/auth/provider/BackendAuthResult.java +++ b/src/main/java/io/kamax/mxisd/auth/provider/BackendAuthResult.java @@ -20,7 +20,7 @@ package io.kamax.mxisd.auth.provider; -import io.kamax.matrix.ThreePid; +import io.kamax.matrix._ThreePid; import io.kamax.mxisd.UserID; import io.kamax.mxisd.UserIdType; @@ -32,13 +32,13 @@ public class BackendAuthResult { public static class BackendAuthProfile { private String displayName; - private Set threePids = new HashSet<>(); + private Set<_ThreePid> threePids = new HashSet<>(); public String getDisplayName() { return displayName; } - public Set getThreePids() { + public Set<_ThreePid> getThreePids() { return threePids; } } @@ -85,7 +85,7 @@ public class BackendAuthResult { return profile; } - public BackendAuthResult withThreePid(ThreePid threePid) { + public BackendAuthResult withThreePid(_ThreePid threePid) { this.profile.threePids.add(threePid); return this; diff --git a/src/main/java/io/kamax/mxisd/backend/memory/MemoryIdentityStore.java b/src/main/java/io/kamax/mxisd/backend/memory/MemoryIdentityStore.java index c9fcd1b..8d14a95 100644 --- a/src/main/java/io/kamax/mxisd/backend/memory/MemoryIdentityStore.java +++ b/src/main/java/io/kamax/mxisd/backend/memory/MemoryIdentityStore.java @@ -162,7 +162,10 @@ public class MemoryIdentityStore implements AuthenticatorProvider, IDirectoryPro if (!StringUtils.equals(id.getUsername(), mxid.getLocalPart())) { return BackendAuthResult.failure(); } else { - return BackendAuthResult.success(mxid.getId(), UserIdType.MatrixID, ""); + BackendAuthResult result = new BackendAuthResult(); + id.getThreepids().forEach(result::withThreePid); + result.succeed(mxid.getId(), UserIdType.MatrixID.getId(), ""); + return result; } }).orElseGet(BackendAuthResult::failure); }