From 2e6368d11af4a7f575518ffe6387d2905e46f83f Mon Sep 17 00:00:00 2001 From: Addison Beck Date: Wed, 18 Nov 2020 10:20:59 -0500 Subject: [PATCH] Set user API key on account creation through SSO auto provision (#1003) --- bitwarden_license/src/Sso/Controllers/AccountController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bitwarden_license/src/Sso/Controllers/AccountController.cs b/bitwarden_license/src/Sso/Controllers/AccountController.cs index 3ab0d84ab7..e145d33932 100644 --- a/bitwarden_license/src/Sso/Controllers/AccountController.cs +++ b/bitwarden_license/src/Sso/Controllers/AccountController.cs @@ -21,6 +21,7 @@ using System.Linq; using System.Security.Claims; using System.Threading.Tasks; using Bit.Core.Models.Api; +using Bit.Core.Utilities; namespace Bit.Sso.Controllers { @@ -453,7 +454,8 @@ namespace Bit.Sso.Controllers user = new User { Name = name, - Email = email + Email = email, + ApiKey = CoreHelpers.SecureRandomString(30) }; await _userService.RegisterUserAsync(user);