This repository was archived by the owner on Feb 23, 2025. It is now read-only.
File tree 3 files changed +11
-11
lines changed
clients/ConsoleClientWithBrowser
3 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFramework >netcoreapp3.1 </TargetFramework >
4
+ <TargetFramework >net6.0 </TargetFramework >
5
5
<OutputType >Exe</OutputType >
6
6
</PropertyGroup >
7
7
12
12
13
13
<ItemGroup >
14
14
<FrameworkReference Include =" Microsoft.AspNetCore.App" />
15
- <PackageReference Include =" Serilog.Extensions.Logging" Version =" 3.0.1 " />
15
+ <PackageReference Include =" Serilog.Extensions.Logging" Version =" 3.1.0 " />
16
16
<PackageReference Include =" Serilog.Sinks.Console" Version =" 3.1.1" />
17
17
</ItemGroup >
18
18
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ namespace ConsoleClientWithBrowser
11
11
{
12
12
public class Program
13
13
{
14
- static string _authority = "https://demo.identityserver.io " ;
15
- static string _api = "https://demo.identityserver.io /api/test" ;
14
+ static string _authority = "https://demo.duendesoftware.com " ;
15
+ static string _api = "https://demo.duendesoftware.com /api/test" ;
16
16
17
17
static OidcClient _oidcClient ;
18
18
static HttpClient _apiClient = new HttpClient { BaseAddress = new Uri ( _api ) } ;
@@ -46,7 +46,7 @@ private static async Task SignIn()
46
46
47
47
Browser = browser ,
48
48
IdentityTokenValidator = new JwtHandlerIdentityTokenValidator ( ) ,
49
- RefreshTokenInnerHttpHandler = new HttpClientHandler ( )
49
+ RefreshTokenInnerHttpHandler = new SocketsHttpHandler ( )
50
50
} ;
51
51
52
52
var serilog = new LoggerConfiguration ( )
Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ void Configure(IApplicationBuilder app)
139
139
{
140
140
if ( ctx . Request . Method == "GET" )
141
141
{
142
- SetResult ( ctx . Request . QueryString . Value , ctx ) ;
142
+ await SetResultAsync ( ctx . Request . QueryString . Value , ctx ) ;
143
143
}
144
144
else
145
145
{
@@ -148,23 +148,23 @@ void Configure(IApplicationBuilder app)
148
148
} ) ;
149
149
}
150
150
151
- private void SetResult ( string value , HttpContext ctx )
151
+ private async Task SetResultAsync ( string value , HttpContext ctx )
152
152
{
153
153
_source . TrySetResult ( value ) ;
154
154
155
155
try
156
156
{
157
157
ctx . Response . StatusCode = 200 ;
158
158
ctx . Response . ContentType = "text/html" ;
159
- ctx . Response . WriteAsync ( "<h1>You can now return to the application.</h1>" ) ;
160
- ctx . Response . Body . Flush ( ) ;
159
+ await ctx . Response . WriteAsync ( "<h1>You can now return to the application.</h1>" ) ;
160
+ await ctx . Response . Body . FlushAsync ( ) ;
161
161
}
162
162
catch
163
163
{
164
164
ctx . Response . StatusCode = 400 ;
165
165
ctx . Response . ContentType = "text/html" ;
166
- ctx . Response . WriteAsync ( "<h1>Invalid request.</h1>" ) ;
167
- ctx . Response . Body . Flush ( ) ;
166
+ await ctx . Response . WriteAsync ( "<h1>Invalid request.</h1>" ) ;
167
+ await ctx . Response . Body . FlushAsync ( ) ;
168
168
}
169
169
}
170
170
You can’t perform that action at this time.
0 commit comments