Skip to content

Commit 0a4ae42

Browse files
authored
Merge pull request #24 from DuendeSoftware/wca/jwt-decoder
Adds a JWT decoder utility
2 parents f102699 + 9289349 commit 0a4ae42

File tree

7 files changed

+765
-2
lines changed

7 files changed

+765
-2
lines changed

src/Pages/Home/JwtDecoder/JwtDecoder.cshtml

Lines changed: 667 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using Microsoft.AspNetCore.Authorization;
2+
using Microsoft.AspNetCore.Mvc.RazorPages;
3+
4+
namespace IdentityServerHost.Pages.Home;
5+
6+
[AllowAnonymous]
7+
public class JwtDecoder : PageModel
8+
{
9+
}

src/Pages/Shared/_Layout.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<body>
2323
<partial name="_Nav" />
2424

25-
<div class="container body-container">
25+
<div class="container-fluid container-lg body-container">
2626
@RenderBody()
2727
</div>
2828

src/Pages/Shared/_Nav.cshtml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@
3535
<li class="nav-item">
3636
<a class="nav-link text-white" href="/#sample-keys">Keys</a>
3737
</li>
38+
<li class="nav-item">
39+
<a class="nav-link text-white" href="/jwt-decoder">JWT Decoder</a>
40+
</li>
3841
<li class="nav-item">
3942
@if (!string.IsNullOrWhiteSpace(name))
4043
{

src/wwwroot/css/site.css

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,39 @@ a.navbar-brand .icon-banner {
107107
.grants-page .card label {
108108
font-weight: bold;
109109
}
110+
111+
.jwt-decoder-container .row {
112+
height: 40vh;
113+
}
114+
.jwt-decoder-container .jwt-decoded {
115+
text-wrap: auto;
116+
background-color: #000000;
117+
}
118+
.jwt-decoder-container .jwt-decoded.jwt-header {
119+
color: rgb(253.5223880597, 157.4776119403, 157.4776119403);
120+
}
121+
.jwt-decoder-container .jwt-decoded.jwt-payload {
122+
color: #46ec88;
123+
}
124+
.jwt-decoder-container .jwt-decoded.jwt-signature {
125+
color: rgb(245.7438016529, 201.7768595041, 124.2561983471);
126+
}
127+
.jwt-decoder-container .jwt-input-editable {
128+
word-wrap: anywhere;
129+
}
130+
.jwt-decoder-container .jwt-input-editable .text-danger {
131+
color: rgb(253.5223880597, 157.4776119403, 157.4776119403) !important;
132+
}
133+
.jwt-decoder-container .jwt-input-editable .text-success {
134+
color: #46ec88 !important;
135+
}
136+
.jwt-decoder-container .jwt-input-editable .text-warning {
137+
color: rgb(245.7438016529, 201.7768595041, 124.2561983471) !important;
138+
}
139+
.jwt-decoder-container .json-content, .jwt-decoder-container .jwt-input-editable {
140+
font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
141+
font-size: 1em;
142+
}
143+
.jwt-decoder-container .jwt-signature {
144+
font-size: 1em;
145+
}

src/wwwroot/css/site.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wwwroot/css/site.scss

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,52 @@ a.navbar-brand {
118118
font-weight: bold;
119119
}
120120
}
121+
}
122+
123+
.jwt-decoder-container {
124+
.row {
125+
height: 40vh;
126+
}
127+
128+
.jwt-decoded {
129+
text-wrap: auto;
130+
background-color: #000000;
131+
132+
&.jwt-header {
133+
color: lighten(#fc3939, 20%);
134+
}
135+
136+
&.jwt-payload {
137+
color: lighten(#13b955, 20%);
138+
}
139+
140+
&.jwt-signature {
141+
color: lighten(#efa31d, 20%);
142+
}
143+
}
144+
145+
.jwt-input-editable {
146+
word-wrap: anywhere;
147+
148+
.text-danger {
149+
color: lighten(#fc3939, 20%) !important;
150+
}
151+
152+
.text-success {
153+
color: lighten(#13b955, 20%) !important;
154+
}
155+
156+
.text-warning {
157+
color: lighten(#efa31d, 20%) !important;
158+
}
159+
}
160+
161+
.json-content, .jwt-input-editable {
162+
font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
163+
font-size: 1em;
164+
}
165+
166+
.jwt-signature {
167+
font-size: 1em;
168+
}
121169
}

0 commit comments

Comments
 (0)