pass OrgId to SSO login while using CME (#1646)

This commit is contained in:
Jake Fink 2021-11-16 09:34:26 -05:00 committed by GitHub
parent 13869b5a1b
commit 3ee80beda8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View file

@ -139,7 +139,7 @@ namespace Bit.App.Pages
var code = GetResultCode(authResult, state);
if (!string.IsNullOrEmpty(code))
{
await LogIn(code, codeVerifier, redirectUri);
await LogIn(code, codeVerifier, redirectUri, OrgIdentifier);
}
else
{
@ -164,11 +164,11 @@ namespace Bit.App.Pages
return code;
}
private async Task LogIn(string code, string codeVerifier, string redirectUri)
private async Task LogIn(string code, string codeVerifier, string redirectUri, string orgId)
{
try
{
var response = await _authService.LogInSsoAsync(code, codeVerifier, redirectUri);
var response = await _authService.LogInSsoAsync(code, codeVerifier, redirectUri, orgId);
await AppHelpers.ResetInvalidUnlockAttemptsAsync();
if (RememberOrgIdentifier)
{

View file

@ -22,7 +22,7 @@ namespace Bit.Core.Abstractions
bool AuthingWithPassword();
List<TwoFactorProvider> GetSupportedTwoFactorProviders();
Task<AuthResult> LogInAsync(string email, string masterPassword, string captchaToken);
Task<AuthResult> LogInSsoAsync(string code, string codeVerifier, string redirectUrl);
Task<AuthResult> LogInSsoAsync(string code, string codeVerifier, string redirectUrl, string orgId);
Task<AuthResult> LogInCompleteAsync(string email, string masterPassword, TwoFactorProviderType twoFactorProvider, string twoFactorToken, bool? remember = null);
Task<AuthResult> LogInTwoFactorAsync(TwoFactorProviderType twoFactorProvider, string twoFactorToken, bool? remember = null);
void LogOut(Action callback);

View file

@ -136,10 +136,10 @@ namespace Bit.Core.Services
null, captchaToken);
}
public async Task<AuthResult> LogInSsoAsync(string code, string codeVerifier, string redirectUrl)
public async Task<AuthResult> LogInSsoAsync(string code, string codeVerifier, string redirectUrl, string orgId)
{
SelectedTwoFactorProviderType = null;
return await LogInHelperAsync(null, null, null, code, codeVerifier, redirectUrl, null, null, null, null);
return await LogInHelperAsync(null, null, null, code, codeVerifier, redirectUrl, null, orgId: orgId);
}
public Task<AuthResult> LogInTwoFactorAsync(TwoFactorProviderType twoFactorProvider, string twoFactorToken,