Skip to content

Commit c9db42c

Browse files
authored
Merge pull request #44 from linianhui/upgrade-package
Upgrade package
2 parents c70eb38 + 76050df commit c9db42c

File tree

8 files changed

+101
-23
lines changed

8 files changed

+101
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<meta charset="utf-8" />
@@ -8,8 +8,8 @@
88
<header>
99
<nav>
1010
@if (this.User != null
11-
&& this.User.Identity != null
12-
&& this.User.Identity.IsAuthenticated == true)
11+
&& this.User.Identity != null
12+
&& this.User.Identity.IsAuthenticated == true)
1313
{
1414
@Html.RouteLink("Logout", "account-logout")
1515
}
@@ -19,11 +19,35 @@
1919
<br />
2020
@Html.RouteLink("Login (QQ Mobile)", "account-login", new { idp = "qq", returnUri = this.Context.Request.Path.Value, isMobile = true })
2121
<br />
22-
@Html.RouteLink("Login (Github)", "account-login", new { idp = "github", returnUri = this.Context.Request.Path.Value})
22+
@Html.RouteLink("Login (Github)", "account-login", new { idp = "github", returnUri = this.Context.Request.Path.Value })
2323
}
2424
</nav>
2525
</header>
2626
<br />
2727
@RenderBody()
28+
<footer>
29+
@{ var OSArchitecture = System.Runtime.InteropServices.RuntimeInformation.OSArchitecture.ToString();
30+
var OSDescription = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
31+
var ProcessArchitecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString();
32+
var FrameworkDescription = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; }
33+
<br />
34+
<table>
35+
<tr>
36+
<td colspan="2">Runtime Info</td>
37+
</tr>
38+
<tr>
39+
<td>OS</td>
40+
<td>@OSDescription @OSArchitecture</td>
41+
</tr>
42+
<tr>
43+
<td>CPU</td>
44+
<td>@ProcessArchitecture</td>
45+
</tr>
46+
<tr>
47+
<td>Framework</td>
48+
<td>@FrameworkDescription</td>
49+
</tr>
50+
</table>
51+
</footer>
2852
</body>
29-
</html>
53+
</html>

1-src/web.oidc.client.hybrid/Views/Shared/_Layout.cshtml

+29-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@using Microsoft.AspNetCore.Http.Extensions
1+
@using Microsoft.AspNetCore.Http.Extensions
22
<!DOCTYPE html>
33
<html>
44
<head>
@@ -9,8 +9,8 @@
99
<header>
1010
<nav>
1111
@if (this.User != null
12-
&& this.User.Identity != null
13-
&& this.User.Identity.IsAuthenticated == true)
12+
&& this.User.Identity != null
13+
&& this.User.Identity.IsAuthenticated == true)
1414
{
1515
@Html.RouteLink("Logout", "account-logout")
1616
}
@@ -26,5 +26,30 @@
2626
</header>
2727
<br />
2828
@RenderBody()
29+
30+
<footer>
31+
@{ var OSArchitecture = System.Runtime.InteropServices.RuntimeInformation.OSArchitecture.ToString();
32+
var OSDescription = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
33+
var ProcessArchitecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString();
34+
var FrameworkDescription = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; }
35+
<br />
36+
<table>
37+
<tr>
38+
<td colspan="2">Runtime Info</td>
39+
</tr>
40+
<tr>
41+
<td>OS</td>
42+
<td>@OSDescription @OSArchitecture</td>
43+
</tr>
44+
<tr>
45+
<td>CPU</td>
46+
<td>@ProcessArchitecture</td>
47+
</tr>
48+
<tr>
49+
<td>Framework</td>
50+
<td>@FrameworkDescription</td>
51+
</tr>
52+
</table>
53+
</footer>
2954
</body>
30-
</html>
55+
</html>

1-src/web.oidc.server.ids4/Views/Shared/_Layout.cshtml

+26-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!DOCTYPE html>
1+
<!DOCTYPE html>
22
<html>
33
<head>
44
<meta charset="utf-8" />
@@ -8,5 +8,30 @@
88
<div>
99
@RenderBody()
1010
</div>
11+
<footer>
12+
@{
13+
var OSArchitecture = System.Runtime.InteropServices.RuntimeInformation.OSArchitecture.ToString();
14+
var OSDescription = System.Runtime.InteropServices.RuntimeInformation.OSDescription;
15+
var ProcessArchitecture = System.Runtime.InteropServices.RuntimeInformation.ProcessArchitecture.ToString();
16+
var FrameworkDescription = System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription; }
17+
<br/>
18+
<table>
19+
<tr>
20+
<td colspan="2">Runtime Info</td>
21+
</tr>
22+
<tr>
23+
<td>OS</td>
24+
<td>@OSDescription @OSArchitecture</td>
25+
</tr>
26+
<tr>
27+
<td>CPU</td>
28+
<td>@ProcessArchitecture</td>
29+
</tr>
30+
<tr>
31+
<td>Framework</td>
32+
<td>@FrameworkDescription</td>
33+
</tr>
34+
</table>
35+
</footer>
1136
</body>
1237
</html>

1-src/web.oidc.server.ids4/web.oidc.server.ids4.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="IdentityServer4" Version="4.1.1" />
19+
<PackageReference Include="IdentityServer4" Version="4.1.2" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

1-src/wpf.oidc.client.authorization-code/Main.xaml.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Windows;
2-
using Newtonsoft.Json;
32
using WPFClient.Models;
43
using WPFClient.Oidc;
54

@@ -44,11 +43,13 @@ private TokenModel GetTokenModel()
4443
return new TokenModel();
4544
}
4645

46+
var json= token.RootElement;
47+
4748
return new TokenModel
4849
{
49-
Token = token.ToString(Formatting.Indented),
50-
IdToken = JwtModel.From(token.Value<string>("id_token")),
51-
AccessToken = JwtModel.From(token.Value<string>("access_token")),
50+
Token = json.ToString(),
51+
IdToken = JwtModel.From(json.GetProperty("id_token").GetString()),
52+
AccessToken = JwtModel.From(json.GetProperty("access_token").GetString()),
5253
};
5354
}
5455
}

1-src/wpf.oidc.client.authorization-code/Models/JwtModel.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using Newtonsoft.Json;
21
using System.IdentityModel.Tokens.Jwt;
2+
using System.Text.Json;
33

44
namespace WPFClient.Models
55
{
@@ -13,7 +13,10 @@ public class JwtModel
1313

1414
public override string ToString()
1515
{
16-
return JsonConvert.SerializeObject(this, Formatting.Indented);
16+
return JsonSerializer.Serialize(this, new JsonSerializerOptions
17+
{
18+
WriteIndented = true
19+
});
1720
}
1821

1922
public static JwtModel From(string jwtString)

1-src/wpf.oidc.client.authorization-code/Oidc/TokenFile.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
using Newtonsoft.Json.Linq;
21
using System;
32
using System.IO;
3+
using System.Text.Json;
44

55
namespace WPFClient.Oidc
66
{
77
public static class TokenFile
88
{
99
private static string TokenFilePath => Environment.CurrentDirectory + "/token.json";
1010

11-
public static JObject Read()
11+
public static JsonDocument Read()
1212
{
1313
if (File.Exists(TokenFilePath))
1414
{
15-
return JObject.Parse(File.ReadAllText(TokenFilePath));
15+
return JsonDocument.Parse(File.ReadAllText(TokenFilePath));
1616
}
1717

1818
return null;
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
1+
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
22

33
<PropertyGroup>
44
<OutputType>WinExe</OutputType>
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
13-
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.7.1" />
12+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.11.1" />
13+
<PackageReference Include="System.Text.Json" Version="5.0.2" />
1414
</ItemGroup>
1515

1616
</Project>

0 commit comments

Comments
 (0)