|
|
@ -1,12 +1,10 @@ |
|
|
|
|
|
|
|
|
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using IdentityServer4.Models; |
|
|
|
|
|
|
|
namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewModels |
|
|
|
{ |
|
|
|
public class ConsentViewModel : ConsentInputModel |
|
|
|
public record ConsentViewModel : ConsentInputModel |
|
|
|
{ |
|
|
|
public ConsentViewModel(ConsentInputModel model, string returnUrl, AuthorizationRequest request, Client client, Resources resources) |
|
|
|
{ |
|
|
@ -24,16 +22,16 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewMo |
|
|
|
ResourceScopes = resources.ApiResources.SelectMany(x => x.Scopes).Select(x => new ScopeViewModel(x, ScopesConsented.Contains(x.Name) || model == null)).ToArray(); |
|
|
|
} |
|
|
|
|
|
|
|
public string ClientName { get; set; } |
|
|
|
public string ClientUrl { get; set; } |
|
|
|
public string ClientLogoUrl { get; set; } |
|
|
|
public bool AllowRememberConsent { get; set; } |
|
|
|
public string ClientName { get; init; } |
|
|
|
public string ClientUrl { get; init; } |
|
|
|
public string ClientLogoUrl { get; init; } |
|
|
|
public bool AllowRememberConsent { get; init; } |
|
|
|
|
|
|
|
public IEnumerable<ScopeViewModel> IdentityScopes { get; set; } |
|
|
|
public IEnumerable<ScopeViewModel> ResourceScopes { get; set; } |
|
|
|
public IEnumerable<ScopeViewModel> IdentityScopes { get; init; } |
|
|
|
public IEnumerable<ScopeViewModel> ResourceScopes { get; init; } |
|
|
|
} |
|
|
|
|
|
|
|
public class ScopeViewModel |
|
|
|
public record ScopeViewModel |
|
|
|
{ |
|
|
|
public ScopeViewModel(Scope scope, bool check) |
|
|
|
{ |
|
|
@ -55,11 +53,11 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API.Models.AccountViewMo |
|
|
|
Checked = check || identity.Required; |
|
|
|
} |
|
|
|
|
|
|
|
public string Name { get; set; } |
|
|
|
public string DisplayName { get; set; } |
|
|
|
public string Description { get; set; } |
|
|
|
public bool Emphasize { get; set; } |
|
|
|
public bool Required { get; set; } |
|
|
|
public bool Checked { get; set; } |
|
|
|
public string Name { get; init; } |
|
|
|
public string DisplayName { get; init; } |
|
|
|
public string Description { get; init; } |
|
|
|
public bool Emphasize { get; init; } |
|
|
|
public bool Required { get; init; } |
|
|
|
public bool Checked { get; init; } |
|
|
|
} |
|
|
|
} |