Skip to content

Commit

Permalink
update sample client
Browse files Browse the repository at this point in the history
  • Loading branch information
leastprivilege committed Dec 13, 2021
1 parent d2f58f6 commit f35b3f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand All @@ -12,7 +12,7 @@

<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions clients/ConsoleClientWithBrowser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ namespace ConsoleClientWithBrowser
{
public class Program
{
static string _authority = "https://demo.identityserver.io";
static string _api = "https://demo.identityserver.io/api/test";
static string _authority = "https://demo.duendesoftware.com";
static string _api = "https://demo.duendesoftware.com/api/test";

static OidcClient _oidcClient;
static HttpClient _apiClient = new HttpClient { BaseAddress = new Uri(_api) };
Expand Down Expand Up @@ -46,7 +46,7 @@ private static async Task SignIn()

Browser = browser,
IdentityTokenValidator = new JwtHandlerIdentityTokenValidator(),
RefreshTokenInnerHttpHandler = new HttpClientHandler()
RefreshTokenInnerHttpHandler = new SocketsHttpHandler()
};

var serilog = new LoggerConfiguration()
Expand Down
12 changes: 6 additions & 6 deletions clients/ConsoleClientWithBrowser/SystemBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void Configure(IApplicationBuilder app)
{
if (ctx.Request.Method == "GET")
{
SetResult(ctx.Request.QueryString.Value, ctx);
await SetResultAsync(ctx.Request.QueryString.Value, ctx);
}
else
{
Expand All @@ -148,23 +148,23 @@ void Configure(IApplicationBuilder app)
});
}

private void SetResult(string value, HttpContext ctx)
private async Task SetResultAsync(string value, HttpContext ctx)
{
_source.TrySetResult(value);

try
{
ctx.Response.StatusCode = 200;
ctx.Response.ContentType = "text/html";
ctx.Response.WriteAsync("<h1>You can now return to the application.</h1>");
ctx.Response.Body.Flush();
await ctx.Response.WriteAsync("<h1>You can now return to the application.</h1>");
await ctx.Response.Body.FlushAsync();
}
catch
{
ctx.Response.StatusCode = 400;
ctx.Response.ContentType = "text/html";
ctx.Response.WriteAsync("<h1>Invalid request.</h1>");
ctx.Response.Body.Flush();
await ctx.Response.WriteAsync("<h1>Invalid request.</h1>");
await ctx.Response.Body.FlushAsync();
}
}

Expand Down

0 comments on commit f35b3f0

Please sign in to comment.