File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
driver-core/src/main/com/mongodb Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -104,17 +104,29 @@ public final class MongoCredential {
104
104
*/
105
105
public static final String CANONICALIZE_HOST_NAME_KEY = "CANONICALIZE_HOST_NAME" ;
106
106
107
- /*
108
- * Mechanism property key for overriding the SasClient properties for GSSAPI authentication.
107
+ /**
108
+ * Mechanism property key for overriding the SaslClient properties for GSSAPI authentication.
109
+ *
110
+ * The value of this property must be a {@code Map<String, Object>}. In most cases there is no need to set this mechanism property.
111
+ * But if an application does:
112
+ * <ul>
113
+ * <li>Generally it must set the {@link javax.security.sasl.Sasl#CREDENTIALS} property to an instance of
114
+ * {@link org.ietf.jgss.GSSCredential}.</li>
115
+ * <li>It's recommended that it set the {@link javax.security.sasl.Sasl#MAX_BUFFER} property to "0" to ensure compatibility with all
116
+ * versions of MongoDB.</li>
117
+ * </ul>
109
118
*
110
119
* @see #createGSSAPICredential(String)
111
120
* @see #withMechanismProperty(String, Object)
121
+ * @see javax.security.sasl.Sasl
122
+ * @see javax.security.sasl.Sasl#CREDENTIALS
123
+ * @see javax.security.sasl.Sasl#MAX_BUFFER
112
124
* @since 3.3
113
125
*/
114
126
public static final String JAVA_SASL_CLIENT_PROPERTIES_KEY = "JAVA_SASL_CLIENT_PROPERTIES" ;
115
127
116
- /*
117
- * Mechanism property key for overriding the {@link javax.security.Subject} under which GSSAPI authentication executes.
128
+ /**
129
+ * Mechanism property key for overriding the {@link javax.security.auth. Subject} under which GSSAPI authentication executes.
118
130
*
119
131
* @see #createGSSAPICredential(String)
120
132
* @see #withMechanismProperty(String, Object)
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ protected SaslClient createSaslClient(final ServerAddress serverAddress) {
65
65
Map <String , Object > saslClientProperties = getCredential ().getMechanismProperty (JAVA_SASL_CLIENT_PROPERTIES_KEY , null );
66
66
if (saslClientProperties == null ) {
67
67
saslClientProperties = new HashMap <String , Object >();
68
+ saslClientProperties .put (Sasl .MAX_BUFFER , "0" );
68
69
saslClientProperties .put (Sasl .CREDENTIALS , getGSSCredential (credential .getUserName ()));
69
70
}
70
71
You can’t perform that action at this time.
0 commit comments