@using Microsoft.AspNetCore.Http; @using SimpleIdServer.IdServer.Domains; @using SimpleIdp.Resources @using System.Security.Claims; @model SimpleIdServer.IdServer.UI.ViewModels.ProfileViewModel @{ ViewBag.Title = ProfileResource.title; Layout = "~/Views/Shared/_Layout.cshtml"; Func getClaim = (str) => { var cl = User.Claims.FirstOrDefault(c => c.Type == str); if (cl == null) return "-"; return cl.Value; }; var basePath = Context.Request.GetAbsoluteUriWithVirtualPath(); var returnUrl = $"{basePath}{Url.Action("Profile", "Home")}"; }
@Html.UserPicture(User, Model.Picture, true)
  • @ProfileResource.subject
    @getClaim(ClaimTypes.NameIdentifier)
  • @ProfileResource.name
    @User.Identity.Name
  • @ProfileResource.qrcode_otp
    @if (!Model.HasOtpKey) {
    @ProfileResource.no_otp
    } else {
    }
@ProfileResource.approved_apps_title

@ProfileResource.approved_apps_description

@foreach (var consent in Model.Consents.OrderBy(c => c.ClientName)) { }
@ProfileResource.client @ProfileResource.scopes
@Html.ClientPicture(consent.ClientUri) @(string.IsNullOrWhiteSpace(consent.ClientName) ? '-' : consent.ClientName) @if(consent.ScopeNames != null && consent.ScopeNames.Any()) { foreach(var scopeName in consent.ScopeNames) { @scopeName } } else { - } @ProfileResource.revoke_access
@ProfileResource.pending_request_title

@ProfileResource.pending_request_description

@if(Model.PendingRequests != null && Model.PendingRequests.Any()) { @foreach (var consent in Model.PendingRequests.Where(p => p.Owner == getClaim(ClaimTypes.NameIdentifier) && p.Status == UMAPendingRequestStatus.TOBECONFIRMED).OrderByDescending(u => u.CreateDateTime)) { }
@ProfileResource.resource @ProfileResource.scopes @ProfileResource.requester
@(string.IsNullOrWhiteSpace(consent.ResourceName) ? '-' : consent.ResourceName) @if(consent.Scopes != null && consent.Scopes.Any()) { - } @foreach(var scope in consent.Scopes) { @scope } @consent.Requester @ProfileResource.revoke_access @ProfileResource.accept_access
} else { @ProfileResource.no_pending_request }
@ProfileResource.external_accounts_title

@ProfileResource.external_accounts_description

@if (Model.Profiles != null && Model.Profiles.Any()) { @foreach (var externalAccount in Model.Profiles) { }
@ProfileResource.account_name @ProfileResource.account_login @ProfileResource.created_at
@externalAccount.Scheme @externalAccount.Subject @externalAccount.CreateDateTime.ToString("dd/M/yyyy HH:mm:ss") @using (Html.BeginForm("Unlink", "Home", FormMethod.Post)) { @Html.AntiForgeryToken() }
} else { @ProfileResource.no_external_accounts }
@foreach(var extProvider in Model.ExternalIdProviders) { @extProvider.DisplayName }
@ProfileResource.credentials
@if(Model.AuthenticationMethods != null && Model.AuthenticationMethods.Any(m => m.IsCredentialExists)) {

@ProfileResource.update_your_credentials

foreach(var authenticationMethod in Model.AuthenticationMethods.Where(m => m.IsCredentialExists)) { @authenticationMethod.Name } } else {

@ProfileResource.no_credentials_to_update

}
@if(Model.AuthenticationMethods != null && Model.AuthenticationMethods.Any(m => !m.IsCredentialExists)) {

@ProfileResource.enroll_credentials

foreach (var authenticationMethod in Model.AuthenticationMethods.Where(m => !m.IsCredentialExists)) { @authenticationMethod.Name } } else {

@ProfileResource.no_credentials_to_create

}
@section Scripts { }