@@ -113,20 +113,18 @@ private MongoCredential getMongoCredential() {
113
113
MongoCredential credential = connectionString .getCredential ();
114
114
if (credential != null ) {
115
115
BsonArray callbacks = (BsonArray ) getExpectedValue ("callback" );
116
- if (callbacks != null ) {
117
- for (BsonValue v : callbacks ) {
118
- String string = ((BsonString ) v ).getValue ();
119
- if ("oidcRequest" .equals (string )) {
120
- credential = credential .withMechanismProperty (
121
- REQUEST_TOKEN_CALLBACK_KEY ,
122
- (MongoCredential .OidcRequestCallback ) (context ) -> null );
123
- } else if ("oidcRefresh" .equals (string )) {
124
- credential = credential .withMechanismProperty (
125
- REFRESH_TOKEN_CALLBACK_KEY ,
126
- (MongoCredential .OidcRefreshCallback ) (context ) -> null );
127
- } else {
128
- fail ("Unsupported callback: " + string );
129
- }
116
+ for (BsonValue v : callbacks ) {
117
+ String string = ((BsonString ) v ).getValue ();
118
+ if ("oidcRequest" .equals (string )) {
119
+ credential = credential .withMechanismProperty (
120
+ REQUEST_TOKEN_CALLBACK_KEY ,
121
+ (MongoCredential .OidcRequestCallback ) (context ) -> null );
122
+ } else if ("oidcRefresh" .equals (string )) {
123
+ credential = credential .withMechanismProperty (
124
+ REFRESH_TOKEN_CALLBACK_KEY ,
125
+ (MongoCredential .OidcRefreshCallback ) (context ) -> null );
126
+ } else {
127
+ fail ("Unsupported callback: " + string );
130
128
}
131
129
}
132
130
OidcAuthenticator .OidcValidator .validateBeforeUse (credential );
0 commit comments