Update SSOController.cs

This commit is contained in:
Pfuenzle
2022-02-20 18:08:31 +01:00
committed by GitHub
parent 06ed040381
commit 0eb7cd4f50
+18
View File
@@ -246,6 +246,15 @@ public class SSOController : ControllerBase
{
var authenticationResult = await Authenticate(kvp.Value.Username, kvp.Value.Admin, config.EnableAuthorization, config.EnableAllFolders, kvp.Value.Folders.ToArray(), response)
.ConfigureAwait(false);
if(config.DefaultProvider != "")
{
User user = null;
user = _userManager.GetUserByName(kvp.Value.Username);
user.AuthenticationProviderId = config.DefaultProvider;
await _userManager.UpdateUserAsync(user).ConfigureAwait(false);
}
return Ok(authenticationResult);
}
}
@@ -384,6 +393,15 @@ public class SSOController : ControllerBase
}
var authenticationResult = await Authenticate(samlResponse.GetNameID(), isAdmin, config.EnableAuthorization, config.EnableAllFolders, folders.ToArray(), response)
.ConfigureAwait(false);
if(config.DefaultProvider != "")
{
User user = null;
user = _userManager.GetUserByName(samlResponse.GetNameID());
user.AuthenticationProviderId = config.DefaultProvider;
await _userManager.UpdateUserAsync(user).ConfigureAwait(false);
}
return Ok(authenticationResult);
}
}