Skip to content

Commit dd0f526

Browse files
committed
CSHARP-1842: Add SERVICE_REALM keeping REALM as an alias.
1 parent e7f872a commit dd0f526

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/MongoDB.Driver.Core/Core/Authentication/GssapiAuthenticator.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ public sealed class GssapiAuthenticator : SaslAuthenticator
3232
{
3333
// constants
3434
private const string __canonicalizeHostNamePropertyName = "CANONICALIZE_HOST_NAME";
35+
private const string __realmPropertyName = "REALM";
3536
private const string __serviceNamePropertyName = "SERVICE_NAME";
36-
private const string __serviceRealmPropertyName = "REALM";
37+
private const string __serviceRealmPropertyName = "SERVICE_REALM";
3738

3839
// static properties
3940
/// <summary>
@@ -69,6 +70,18 @@ public static string MechanismName
6970
get { return "GSSAPI"; }
7071
}
7172

73+
/// <summary>
74+
/// Gets the name of the realm property.
75+
/// </summary>
76+
/// <value>
77+
/// The name of the realm property.
78+
/// </value>
79+
[Obsolete("Use ServiceRealmPropertyName")]
80+
public static string RealmPropertyName
81+
{
82+
get { return __realmPropertyName; }
83+
}
84+
7285
/// <summary>
7386
/// Gets the name of the service name property.
7487
/// </summary>
@@ -143,6 +156,7 @@ private static GssapiMechanism CreateMechanism(string username, SecureString pas
143156
serviceName = (string)pair.Value;
144157
break;
145158
case __serviceRealmPropertyName:
159+
case __realmPropertyName:
146160
realm = (string)pair.Value;
147161
break;
148162
case __canonicalizeHostNamePropertyName:

0 commit comments

Comments
 (0)