Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Add descscription to client #2282

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Host/Configuration/Clients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public static IEnumerable<Client> Get()
new Client
{
ClientId = "client",
Description = "Client Credentials",
ClientSecrets =
{
new Secret("secret".Sha256())
Expand All @@ -35,6 +36,7 @@ public static IEnumerable<Client> Get()
new Client
{
ClientId = "client.jwt",
Description = "JWT client",
ClientSecrets =
{
new Secret
Expand All @@ -54,6 +56,7 @@ public static IEnumerable<Client> Get()
new Client
{
ClientId = "client.custom",
Description = "Custom grant type",
ClientSecrets =
{
new Secret("secret".Sha256())
Expand All @@ -69,6 +72,7 @@ public static IEnumerable<Client> Get()
new Client
{
ClientId = "roclient",
Description = "resource owner password client",
ClientSecrets =
{
new Secret("secret".Sha256())
Expand All @@ -91,6 +95,7 @@ public static IEnumerable<Client> Get()
new Client
{
ClientId = "roclient.public",
Description = "resource owner password client",
RequireClientSecret = false,

AllowedGrantTypes = GrantTypes.ResourceOwnerPassword,
Expand Down Expand Up @@ -135,6 +140,7 @@ public static IEnumerable<Client> Get()
new Client
{
ClientId = "roclient.reference",
Description = "resource owner password client",
ClientSecrets =
{
new Secret("secret".Sha256())
Expand All @@ -153,6 +159,7 @@ public static IEnumerable<Client> Get()
{
ClientId = "mvc.implicit",
ClientName = "MVC Implicit",
Description = "MVC Implicit client",
ClientUri = "http://identityserver.io",

AllowedGrantTypes = GrantTypes.Implicit,
Expand All @@ -178,6 +185,7 @@ public static IEnumerable<Client> Get()
{
ClientId = "mvc.manual",
ClientName = "MVC Manual",
Description = "MVC Implicit client",
ClientUri = "http://identityserver.io",

AllowedGrantTypes = GrantTypes.Implicit,
Expand All @@ -200,6 +208,7 @@ public static IEnumerable<Client> Get()
{
ClientId = "mvc.hybrid",
ClientName = "MVC Hybrid",
Description = "MVC Hybrid client",
ClientUri = "http://identityserver.io",
//LogoUri = "https://pbs.twimg.com/profile_images/1612989113/Ki-hanja_400x400.png",

Expand Down
1 change: 1 addition & 0 deletions src/Host/Quickstart/Consent/ConsentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ private ConsentViewModel CreateConsentViewModel(
ReturnUrl = returnUrl,

ClientName = client.ClientName ?? client.ClientId,
Description = client.Description,
ClientUrl = client.ClientUri,
ClientLogoUrl = client.LogoUri,
AllowRememberConsent = client.AllowRememberConsent
Expand Down
3 changes: 2 additions & 1 deletion src/Host/Quickstart/Consent/ConsentViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.


Expand All @@ -9,6 +9,7 @@ namespace IdentityServer4.Quickstart.UI
public class ConsentViewModel : ConsentInputModel
{
public string ClientName { get; set; }
public string Description { get; set; }
public string ClientUrl { get; set; }
public string ClientLogoUrl { get; set; }
public bool AllowRememberConsent { get; set; }
Expand Down
18 changes: 14 additions & 4 deletions src/Host/Views/Consent/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@model ConsentViewModel
@model ConsentViewModel

<div class="page-consent">
<div class="row page-header">
Expand All @@ -8,9 +8,19 @@
<div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
Copy link
Contributor Author

@LindaLawton LindaLawton May 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note. I have urls inserted here and this isnt working due to CORS errors. Not sure what you have been inserting. URL is probably a bad idea on second thought ignore this.

}
<h1>
@Model.ClientName
<small>is requesting your permission</small>
@if (string.IsNullOrWhiteSpace(Model.ClientUrl))
{
@Model.ClientName <small>is requesting your permission</small>
}
else
{
<a href="@Model.ClientUrl">@Model.ClientName</a>
}
</h1>
@if (!string.IsNullOrWhiteSpace(Model.Description))
{
<pre>@Model.Description</pre>
}
</div>
</div>

Expand All @@ -22,7 +32,7 @@
<input type="hidden" asp-for="ReturnUrl" />

<div>Uncheck the permissions you do not wish to grant.</div>

@if (Model.IdentityScopes.Any())
{
<div class="panel panel-default consent-buttons">
Expand Down
7 changes: 6 additions & 1 deletion src/IdentityServer4/Models/Client.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Copyright (c) Brock Allen & Dominick Baier. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.


Expand Down Expand Up @@ -31,6 +31,11 @@ public class Client
/// </summary>
public string ClientId { get; set; }

/// <summary>
/// Description of the client
/// </summary>
public string Description { get; set; }

/// <summary>
/// Gets or sets the protocol type.
/// </summary>
Expand Down