Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4fb0f1c
github: add support for OAuth with GHAE
mjcheetham May 12, 2021
c347cee
msauth: add WAM workaround for elevated procs
mjcheetham May 12, 2021
5dc3657
Merge pull request #343 from mjcheetham/ghae
mjcheetham May 13, 2021
b3cbf05
msauth: address some linting issues with braces
mjcheetham May 13, 2021
301f888
Merge pull request #344 from mjcheetham/wam-elevate
mjcheetham May 14, 2021
41feccd
introduce new windows-broker doc
vtbassmatt May 14, 2021
5d4393b
move wam.md contents into broker doc
vtbassmatt May 14, 2021
2900fb7
msauth: bump MSAL library versions
mjcheetham May 14, 2021
27846cf
shrink images
vtbassmatt May 14, 2021
f9fc319
link, spacing
vtbassmatt May 14, 2021
1d524bd
msauth: set MSAL embedded webview window title
mjcheetham May 14, 2021
16a20fd
Merge pull request #345 from microsoft/wam-docs
vtbassmatt May 14, 2021
df16ce4
docs: update configuration docs to fix links
mjcheetham May 14, 2021
22ad894
docs: update environment docs to fix links
mjcheetham May 14, 2021
caac019
Merge pull request #348 from microsoft/docs-fix
mjcheetham May 14, 2021
42eae07
docs: fix more broken links in environment.md
mjcheetham May 14, 2021
3ec3400
docs: fix more broken links in configuration.md
mjcheetham May 14, 2021
4fd5c90
Merge pull request #346 from mjcheetham/msal-vers
May 14, 2021
d9d62c7
Merge pull request #347 from mjcheetham/msal-title
May 14, 2021
82a67fb
main: rename master branch to main, and drop beta
mjcheetham May 17, 2021
e498936
Merge pull request #349 from mjcheetham/main-rename
mjcheetham May 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
github: add support for OAuth with GHAE
Add support for detecting GitHub AE (GHAE) and enabling the OAuth
authentication mode with the GitHub provider.

https://docs.github.com/en/github-ae@latest/admin/overview/about-github-ae
  • Loading branch information
mjcheetham committed May 12, 2021
commit 4fb0f1c89375928a842e3052f7125637298b39b1
5 changes: 5 additions & 0 deletions src/shared/GitHub/GitHubConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ public static class GitHubConstants
// TODO: update this with a real version number once the GCM OAuth application has been deployed to GHE
public static readonly Version MinimumEnterpriseOAuthVersion = new Version("99.99.99");

/// <summary>
/// The version string returned from the meta API endpoint for GitHub AE instances.
/// </summary>
public const string GitHubAeVersionString = "GitHub AE";

/// <summary>
/// Supported authentication modes for GitHub.com.
/// </summary>
Expand Down
9 changes: 8 additions & 1 deletion src/shared/GitHub/GitHubHostProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,15 @@ internal async Task<AuthenticationModes> GetSupportedAuthenticationModesAsync(Ur
{
modes |= AuthenticationModes.Basic;
}
if (Version.TryParse(metaInfo.InstalledVersion, out var version) && version >= GitHubConstants.MinimumEnterpriseOAuthVersion)

if (StringComparer.OrdinalIgnoreCase.Equals(metaInfo.InstalledVersion, GitHubConstants.GitHubAeVersionString))
{
// Assume all GHAE instances have the GCM OAuth application deployed
modes |= AuthenticationModes.OAuth;
}
else if (Version.TryParse(metaInfo.InstalledVersion, out var version) && version >= GitHubConstants.MinimumEnterpriseOAuthVersion)
{
// Only GHES versions beyond the minimum version have the GCM OAuth application deployed
modes |= AuthenticationModes.OAuth;
}

Expand Down