Skip to content

Commit 6b50dfe

Browse files
author
hideki
committed
Fixed #1333 - OIDC: Obtaining username with refresh-token might have issue
- CBL Java does not set username automatically like CBL iOS. CBL Java needs to set username explicitly.
1 parent 09c7391 commit 6b50dfe

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/java/com/couchbase/lite/replicator/ReplicationInternal.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,10 @@ public void onCompletion(Response _response, Object result, Throwable err) {
467467
if (username != null && username.length() > 0) {
468468
// Found a login session!
469469
Log.d(Log.TAG_SYNC, "%s Active session, logged in as %s", this, username);
470-
fetchRemoteCheckpointDoc();
470+
// currently only OpenIDConnectAuthorizer supports setUsername() method
471+
if (authenticator != null && authenticator instanceof OpenIDConnectAuthorizer)
472+
((OpenIDConnectAuthorizer) authenticator).setUsername(username);
473+
loginFinishedWithError(null);
471474
} else {
472475
// No current login session, so continue to regular login:
473476
Log.d(Log.TAG_SYNC, "%s No active session, going to login", this);

0 commit comments

Comments
 (0)