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

Commit

Permalink
Features/bootstrap update (#4427)
Browse files Browse the repository at this point in the history
* first stab at upating to latest bootstrap and jquery

* update nav, home, and account views

* consent, diagnostics, and grants

* device flows

* review feedback changes
  • Loading branch information
brockallen authored May 22, 2020
1 parent 31f4afe commit 7eda5c9
Show file tree
Hide file tree
Showing 155 changed files with 49,898 additions and 14,533 deletions.
5 changes: 4 additions & 1 deletion src/IdentityServer4/host/Configuration/Resources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public class Resources
new ApiScope("shared.scope"),

// used as a dynamic scope
new ApiScope("transaction")
new ApiScope("transaction", "Transaction")
{
Description = "Some Transaction"
}
};

// API resources are more formal representation of a resource with processing rules and their scopes (if any)
Expand Down
8 changes: 8 additions & 0 deletions src/IdentityServer4/host/Host.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
</PropertyGroup>

<ItemGroup>
<Content Remove="compilerconfig.json" />
</ItemGroup>

<ItemGroup>
<None Include="compilerconfig.json" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Certificate" />

Expand Down
10 changes: 8 additions & 2 deletions src/IdentityServer4/host/Quickstart/Consent/ConsentController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using System.Threading.Tasks;
using IdentityServer4.Validation;
using System.Collections.Generic;
using System;

namespace IdentityServer4.Quickstart.UI
{
Expand Down Expand Up @@ -229,11 +230,16 @@ private ScopeViewModel CreateScopeViewModel(IdentityResource identity, bool chec

public ScopeViewModel CreateScopeViewModel(ParsedScopeValue parsedScopeValue, ApiScope apiScope, bool check)
{
var displayName = apiScope.DisplayName ?? apiScope.Name;
if (!String.IsNullOrWhiteSpace(parsedScopeValue.ParameterValue))
{
displayName += ":" + parsedScopeValue.ParameterValue;
}

return new ScopeViewModel
{
Value = parsedScopeValue.Value,
// todo: use the parsed scope value in the display?
DisplayName = apiScope.DisplayName ?? apiScope.Name,
DisplayName = displayName,
Description = apiScope.Description,
Emphasize = apiScope.Emphasize,
Required = apiScope.Required,
Expand Down
5 changes: 2 additions & 3 deletions src/IdentityServer4/host/Views/Account/AccessDenied.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@

<div class="container">
<div class="page-header">
<div class="lead">
<h1>Access Denied</h1>
<p>You do not have access to that resource.</p>
</div>

<p>You do not have access to that resource.</p>
</div>
2 changes: 1 addition & 1 deletion src/IdentityServer4/host/Views/Account/LoggedOut.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
ViewData["signed-out"] = true;
}

<div class="page-header logged-out">
<div class="logged-out-page">
<h1>
Logout
<small>You are now logged out</small>
Expand Down
63 changes: 31 additions & 32 deletions src/IdentityServer4/host/Views/Account/Login.cshtml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
@model LoginViewModel

<div class="login-page">
<div class="page-header">
<div class="lead">
<h1>Login</h1>
<p>Choose how to login</p>
</div>

<partial name="_ValidationSummary" />
Expand All @@ -12,38 +13,36 @@
@if (Model.EnableLocalLogin)
{
<div class="col-sm-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Local Login</h3>
<div class="card">
<div class="card-header">
<h2>Local Account</h2>
</div>
<div class="panel-body">

<div class="card-body">
<form asp-route="Login">
<input type="hidden" asp-for="ReturnUrl" />

<fieldset>
<div class="form-group">
<label asp-for="Username"></label>
<input class="form-control" placeholder="Username" asp-for="Username" autofocus>
</div>
<div class="form-group">
<label asp-for="Username"></label>
<input class="form-control" placeholder="Username" asp-for="Username" autofocus>
</div>
<div class="form-group">
<label asp-for="Password"></label>
<input type="password" class="form-control" placeholder="Password" asp-for="Password" autocomplete="off">
</div>
@if (Model.AllowRememberLogin)
{
<div class="form-group">
<label asp-for="Password"></label>
<input type="password" class="form-control" placeholder="Password" asp-for="Password" autocomplete="off">
</div>
@if (Model.AllowRememberLogin)
{
<div class="form-group login-remember">
<label asp-for="RememberLogin">
<input asp-for="RememberLogin">
<strong>Remember My Login</strong>
<div class="form-check">
<input class="form-check-input" asp-for="RememberLogin">
<label class="form-check-label" asp-for="RememberLogin">
Remember My Login
</label>
</div>
}
<div class="form-group">
<button class="btn btn-primary" name="button" value="login">Login</button>
<button class="btn btn-default" name="button" value="cancel">Cancel</button>
</div>
</fieldset>
}
<button class="btn btn-primary" name="button" value="login">Login</button>
<button class="btn btn-secondary" name="button" value="cancel">Cancel</button>
</form>
</div>
</div>
Expand All @@ -52,17 +51,17 @@

@if (Model.VisibleExternalProviders.Any())
{
<div class="col-md-6 col-sm-6 external-providers">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">External Login</h3>
<div class="col-sm-6">
<div class="card">
<div class="card-header">
<h2>External Account</h2>
</div>
<div class="panel-body">
<div class="card-body">
<ul class="list-inline">
@foreach (var provider in Model.VisibleExternalProviders)
{
<li>
<a class="btn btn-default"
<li class="list-inline-item">
<a class="btn btn-secondary"
asp-controller="External"
asp-action="Challenge"
asp-route-scheme="@provider.AuthenticationScheme"
Expand All @@ -81,7 +80,7 @@
{
<div class="alert alert-warning">
<strong>Invalid login request</strong>
There are no login schemes configured for this client.
There are no login schemes configured for this request.
</div>
}
</div>
Expand Down
22 changes: 8 additions & 14 deletions src/IdentityServer4/host/Views/Account/Logout.cshtml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
@model LogoutViewModel

<div class="logout-page">
<div class="page-header">
<div class="lead">
<h1>Logout</h1>
<p>Would you like to logut of IdentityServer?</p>
</div>

<div class="row">
<div class="col-sm-6">
<p>Would you like to logout of IdentityServer?</p>
<form asp-action="Logout">
<input type="hidden" name="logoutId" value="@Model.LogoutId" />
<fieldset>
<div class="form-group">
<button class="btn btn-primary">Yes</button>
</div>
</fieldset>
</form>
<form asp-action="Logout">
<input type="hidden" name="logoutId" value="@Model.LogoutId" />
<div class="form-group">
<button class="btn btn-primary">Yes</button>
</div>
</div>
</div>
</form>
</div>
136 changes: 74 additions & 62 deletions src/IdentityServer4/host/Views/Consent/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,92 +1,104 @@
@model ConsentViewModel

<div class="page-consent">
<div class="row page-header">
<div class="col-sm-10">
@if (Model.ClientLogoUrl != null)
{
<div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
}
<h1>
@Model.ClientName
<small>is requesting your permission</small>
</h1>
</div>
<div class="lead">
@if (Model.ClientLogoUrl != null)
{
<div class="client-logo"><img src="@Model.ClientLogoUrl"></div>
}
<h1>
@Model.ClientName
<small class="text-muted">is requesting your permission</small>
</h1>
<p>Uncheck the permissions you do not wish to grant.</p>
</div>

<div class="row">
<div class="col-sm-8">
<partial name="_ValidationSummary" />

<form asp-action="Index" class="consent-form">
<input type="hidden" asp-for="ReturnUrl" />
</div>
</div>

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

<form asp-action="Index">
<input type="hidden" asp-for="ReturnUrl" />
<div class="row">
<div class="col-sm-8">
@if (Model.IdentityScopes.Any())
{
<div class="panel panel-default consent-buttons">
<div class="panel-heading">
<span class="glyphicon glyphicon-user"></span>
Personal Information
<div class="form-group">
<div class="card">
<div class="card-header">
<span class="glyphicon glyphicon-user"></span>
Personal Information
</div>
<ul class="list-group list-group-flush">
@foreach (var scope in Model.IdentityScopes)
{
<partial name="_ScopeListItem" model="@scope" />
}
</ul>
</div>
<ul class="list-group">
@foreach (var scope in Model.IdentityScopes)
{
<partial name="_ScopeListItem" model="@scope" />
}
</ul>
</div>
}

@if (Model.ApiScopes.Any())
{
<div class="panel panel-default">
<div class="panel-heading">
<span class="glyphicon glyphicon-tasks"></span>
Application Access
<div class="form-group">
<div class="card">
<div class="card-header">
<span class="glyphicon glyphicon-tasks"></span>
Application Access
</div>
<ul class="list-group list-group-flush">
@foreach (var scope in Model.ApiScopes)
{
<partial name="_ScopeListItem" model="scope" />
}
</ul>
</div>
<ul class="list-group">
@foreach (var scope in Model.ApiScopes)
{
<partial name="_ScopeListItem" model="scope" />
}
</ul>
</div>
}

<div class="panel panel-default">
<div class="panel-heading">
<span class="glyphicon glyphicon-tasks"></span>
Device Description
</div>
<div class="panel-body">
<input class="form-control" placeholder="Description or name of device" asp-for="Description" autofocus>
<div class="form-group">
<div class="card">
<div class="card-header">
<span class="glyphicon glyphicon-tasks"></span>
Description
</div>
<div class="card-body">
<input class="form-control" placeholder="Description or name of device" asp-for="Description" autofocus>
</div>
</div>
</div>

@if (Model.AllowRememberConsent)
{
<div class="consent-remember">
<label>
<input class="consent-scopecheck" asp-for="RememberConsent" />
<strong>Remember My Decision</strong>
</label>
<div class="form-group">
<div class="form-check">
<input class="form-check-input" asp-for="RememberConsent">
<label class="form-check-label" asp-for="RememberConsent">
<strong>Remember My Decision</strong>
</label>
</div>
</div>
}
</div>
</div>

<div class="consent-buttons">
<button name="button" value="yes" class="btn btn-primary" autofocus>Yes, Allow</button>
<button name="button" value="no" class="btn">No, Do Not Allow</button>
@if (Model.ClientUrl != null)
{
<a class="pull-right btn btn-default" target="_blank" href="@Model.ClientUrl">
<span class="glyphicon glyphicon-info-sign"></span>
<strong>@Model.ClientName</strong>
</a>
}
</div>
</form>
<div class="row">
<div class="col-sm-4">
<button name="button" value="yes" class="btn btn-primary" autofocus>Yes, Allow</button>
<button name="button" value="no" class="btn btn-secondary">No, Do Not Allow</button>
</div>
<div class="col-sm-4 col-lg-auto">
@if (Model.ClientUrl != null)
{
<a class="btn btn-outline-info" href="@Model.ClientUrl">
<span class="glyphicon glyphicon-info-sign"></span>
<strong>@Model.ClientName</strong>
</a>
}
</div>
</div>
</div>
</div>
</form>
</div>
13 changes: 7 additions & 6 deletions src/IdentityServer4/host/Views/Device/Success.cshtml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<div class="page-header">
<h1>
Success
<small>You have successfully authorized the device</small>
</h1>
</div>

<div class="page-device-success">
<div class="lead">
<h1>Success</h1>
<p>You have successfully authorized the device</p>
</div>
</div>
Loading

0 comments on commit 7eda5c9

Please sign in to comment.