@@ -104,7 +104,7 @@ public String getMechanismName() {
104
104
105
105
@ Override
106
106
protected SaslClient createSaslClient (final ServerAddress serverAddress ) {
107
- this .serverAddress = serverAddress ;
107
+ this .serverAddress = assertNotNull ( serverAddress ) ;
108
108
MongoCredentialWithCache mongoCredentialWithCache = getMongoCredentialWithCache ();
109
109
return new OidcSaslClient (mongoCredentialWithCache );
110
110
}
@@ -153,7 +153,7 @@ public void setSpeculativeAuthenticateResponse(@Nullable final BsonDocument resp
153
153
}
154
154
155
155
private boolean isAutomaticAuthentication () {
156
- return getRequestCallback ( ) == null ;
156
+ return getMechanismProperty ( PROVIDER_NAME_KEY ) == null ;
157
157
}
158
158
159
159
private boolean isHumanCallback () {
@@ -602,7 +602,9 @@ public static void validateBeforeUse(final MongoCredential credential) {
602
602
@ VisibleForTesting (otherwise = VisibleForTesting .AccessModifier .PRIVATE )
603
603
static class OidcCallbackContextImpl implements OidcCallbackContext {
604
604
private final Duration timeout ;
605
+ @ Nullable
605
606
private final IdpInfo idpInfo ;
607
+ @ Nullable
606
608
private final String refreshToken ;
607
609
608
610
OidcCallbackContextImpl (final Duration timeout ) {
@@ -613,7 +615,7 @@ static class OidcCallbackContextImpl implements OidcCallbackContext {
613
615
614
616
OidcCallbackContextImpl (final Duration timeout , final IdpInfo idpInfo , @ Nullable final String refreshToken ) {
615
617
this .timeout = assertNotNull (timeout );
616
- this .idpInfo = idpInfo ;
618
+ this .idpInfo = assertNotNull ( idpInfo ) ;
617
619
this .refreshToken = refreshToken ;
618
620
}
619
621
0 commit comments