File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ public static class GitHubConstants
3232 // TODO: update this with a real version number once the GCM OAuth application has been deployed to GHE
3333 public static readonly Version MinimumEnterpriseOAuthVersion = new Version ( "99.99.99" ) ;
3434
35+ /// <summary>
36+ /// The version string returned from the meta API endpoint for GitHub AE instances.
37+ /// </summary>
38+ public const string GitHubAeVersionString = "GitHub AE" ;
39+
3540 /// <summary>
3641 /// Supported authentication modes for GitHub.com.
3742 /// </summary>
Original file line number Diff line number Diff line change @@ -263,8 +263,15 @@ internal async Task<AuthenticationModes> GetSupportedAuthenticationModesAsync(Ur
263263 {
264264 modes |= AuthenticationModes . Basic ;
265265 }
266- if ( Version . TryParse ( metaInfo . InstalledVersion , out var version ) && version >= GitHubConstants . MinimumEnterpriseOAuthVersion )
266+
267+ if ( StringComparer . OrdinalIgnoreCase . Equals ( metaInfo . InstalledVersion , GitHubConstants . GitHubAeVersionString ) )
268+ {
269+ // Assume all GHAE instances have the GCM OAuth application deployed
270+ modes |= AuthenticationModes . OAuth ;
271+ }
272+ else if ( Version . TryParse ( metaInfo . InstalledVersion , out var version ) && version >= GitHubConstants . MinimumEnterpriseOAuthVersion )
267273 {
274+ // Only GHES versions beyond the minimum version have the GCM OAuth application deployed
268275 modes |= AuthenticationModes . OAuth ;
269276 }
270277
You can’t perform that action at this time.
0 commit comments