diff --git a/clients/src/ConsoleDeviceFlow/Program.cs b/clients/src/ConsoleDeviceFlow/Program.cs index 2b8476bc4..3c246f3a3 100644 --- a/clients/src/ConsoleDeviceFlow/Program.cs +++ b/clients/src/ConsoleDeviceFlow/Program.cs @@ -1,4 +1,4 @@ -using Clients; +using Clients; using IdentityModel; using IdentityModel.Client; using System; @@ -35,7 +35,8 @@ static async Task RequestAuthorizationAsync() var response = await client.RequestDeviceAuthorizationAsync(new DeviceAuthorizationRequest { Address = disco.DeviceAuthorizationEndpoint, - ClientId = "device" + ClientId = "device", + ClientCredentialStyle = ClientCredentialStyle.PostBody }); if (response.IsError) throw new Exception(response.Error); diff --git a/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs b/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs index bf2b17064..fca033d4a 100644 --- a/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs +++ b/src/EntityFramework.Storage/Stores/DeviceFlowStore.cs @@ -140,6 +140,8 @@ public virtual async Task UpdateByUserCodeAsync(string userCode, DeviceCode data existing.SubjectId = data.Subject?.FindFirst(JwtClaimTypes.Subject).Value; existing.Data = entity.Data; + existing.SessionId = data.SessionId; + existing.Description = data.Description; try { @@ -194,6 +196,8 @@ public virtual async Task RemoveByDeviceCodeAsync(string deviceCode) /// protected DeviceFlowCodes ToEntity(DeviceCode model, string deviceCode, string userCode) { + // TODO: consider removing this in v7.0 since it's not properly/fully used + if (model == null || deviceCode == null || userCode == null) return null; return new DeviceFlowCodes @@ -202,6 +206,8 @@ protected DeviceFlowCodes ToEntity(DeviceCode model, string deviceCode, string u UserCode = userCode, ClientId = model.ClientId, SubjectId = model.Subject?.FindFirst(JwtClaimTypes.Subject).Value, + SessionId = model.SessionId, + Description = model.Description, CreationTime = model.CreationTime, Expiration = model.CreationTime.AddSeconds(model.Lifetime), Data = Serializer.Serialize(model)