Skip to content
This repository has been archived by the owner on Feb 23, 2025. It is now read-only.

Commit

Permalink
Use PAR in sample clients
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdecock committed Apr 2, 2024
1 parent 55dabd9 commit 2a7e411
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,8 @@ tools/
.idea

# Visual Studio Code workspace options
.vscode
.vscode/settings.json

# Tokens stored by sample clients
clients/*/proofkey
clients/*/refresh_token
42 changes: 42 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ConsoleClientWithBrowser",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-ConsoleClientWithBrowser",
"program": "${workspaceFolder}/clients/ConsoleClientWithBrowser/bin/Debug/net8.0/ConsoleClientWithBrowser.dll",
"args": [],
"cwd": "${workspaceFolder}/clients/ConsoleClientWithBrowser",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"console": "externalTerminal"
},
{
"name": "ConsoleClientWithBrowserAndDPoP",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build-ConsoleClientWithBrowserAndDPoP",
"program": "${workspaceFolder}/clients/ConsoleClientWithBrowserAndDPoP/bin/Debug/net8.0/ConsoleClientWithBrowserAndDPoP.dll",
"args": [],
"cwd": "${workspaceFolder}/clients/ConsoleClientWithBrowserAndDPoP",
"serverReadyAction": {
"action": "openExternally",
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"console": "externalTerminal"
}
]
}
29 changes: 29 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build-ConsoleClientWithBrowser",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/clients/ConsoleClientWithBrowser/ConsoleClientWithBrowser.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "build-ConsoleClientWithBrowserAndDPoP",
"type": "process",
"command": "dotnet",
"args": [
"build",
"${workspaceFolder}/clients/ConsoleClientWithBrowserAndDPoP/ConsoleClientWithBrowserAndDPoP.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
}
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand Down
4 changes: 3 additions & 1 deletion clients/ConsoleClientWithBrowser/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ private static async Task SignIn()

Browser = browser,
IdentityTokenValidator = new JwtHandlerIdentityTokenValidator(),
RefreshTokenInnerHttpHandler = new SocketsHttpHandler()
RefreshTokenInnerHttpHandler = new SocketsHttpHandler(),

UsePushedAuthorization = true
};

var serilog = new LoggerConfiguration()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

Expand Down
1 change: 1 addition & 0 deletions clients/ConsoleClientWithBrowserAndDPoP/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ private static async Task SignIn()
Scope = "openid profile api offline_access",
FilterClaims = false,
Browser = browser,
UsePushedAuthorization = true
};

options.ConfigureDPoP(proofKey);
Expand Down

0 comments on commit 2a7e411

Please sign in to comment.