Skip to content

Commit

Permalink
fix: client page for client creds
Browse files Browse the repository at this point in the history
  • Loading branch information
aguacongas committed Mar 29, 2022
1 parent da77c09 commit ad80949
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,16 +219,19 @@ else
{
<ClientUrisPanel Model="@Model" />
}
<div id="providers" class="card mb-3">
<div class="card-header">
<div class="row">
<h5 class="col">@Localizer["External provider restrictions"]</h5>
@if (!Model.IsClientCredentialOnly())
{
<div id="providers" class="card mb-3">
<div class="card-header">
<div class="row">
<h5 class="col">@Localizer["External provider restrictions"]</h5>
</div>
</div>
<div class="card-body">
<ClientIdpRestrictions Model="@Model" />
</div>
</div>
<div class="card-body">
<ClientIdpRestrictions Model="@Model" />
</div>
</div>
}
<div id="scopes" class="card mb-3">
<div class="card-header">
<div class="row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,25 @@
}
</div>
</div>
@if (_showAllOptions || Model.HasUser())
{
<div class="mb-3 row">
<label class="col col-form-label" for="id-token">
@Localizer["id token lifetime"]
</label>
<div class="col-lg-8 col-sm-12">
<AuthorizedToken Name="id-token" QuickValues="_idTokenQuickValues" @bind-Value="@Model.IdentityTokenLifetime" TokenValueChanged="TokenChanded" />
<div>
<AuthorizeCheckbox Name="include-claims" Label="@Localizer["always include user claims in id token"]" @bind-Value="@Model.AlwaysIncludeUserClaimsInIdToken" />
</div>
<div class="mb-3 row">
<label class="col col-form-label" for="id-token">
@Localizer["id token lifetime"]
</label>
<div class="col-lg-8 col-sm-12">
<AuthorizedToken Name="id-token" QuickValues="_idTokenQuickValues" @bind-Value="@Model.IdentityTokenLifetime" TokenValueChanged="TokenChanded" />
<div>
<AuthorizeCheckbox Name="include-claims" Label="@Localizer["always include user claims in id token"]" @bind-Value="@Model.AlwaysIncludeUserClaimsInIdToken" />
</div>
</div>
<div class="mb-3 row">
<label class="col col-form-label" for="salt">
@Localizer["pairwise subject salt"]
</label>
<div class="col-lg-8 col-sm-12">
<AuthorizeText Id="salt" @bind-Value="@Model.PairWiseSubjectSalt" MaxLength="200" />
</div>
</div>
<div class="mb-3 row">
<label class="col col-form-label" for="salt">
@Localizer["pairwise subject salt"]
</label>
<div class="col-lg-8 col-sm-12">
<AuthorizeText Id="salt" @bind-Value="@Model.PairWiseSubjectSalt" MaxLength="200" />
</div>
}
</div>
@if (_showAllOptions || Model.CanUseRefreshToken())
{
<div class="mb-3 row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ namespace Aguacongas.TheIdServer.BlazorApp.Pages.Client.Extentions
{
public static class ClientExtensions
{
public static bool IsClientCredentialOnly(this IdentityServer.Store.Entity.Client client)
{
return client.AllowedGrantTypes.All(g => g.GrantType == "client_credentials");
}

public static bool IsWebClient(this IdentityServer.Store.Entity.Client client)
{
return client.ProtocolType == "wsfed" ||
Expand Down

0 comments on commit ad80949

Please sign in to comment.