Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to use .NET 8 and updated JWT libraries #3

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# DoorDash API Windows Forms Sample App
This sample application illustrates the three parts of the DoorDash JWT. It builds a token that is valid for 30 minutes. Please obtain a set of DoorDash Credentials (Developer ID, Key ID, and Signing Secret) in the [DoorDash Developer Portal](https://developer.doordash.com/portal/integration/drive/credentials) to use in the application.

This application targets [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) and requires a Windows OS to run. The code source and build files provided in this repository are samples and not intended for production and are not supported.
This application targets [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) and requires a Windows OS to run. The code source and build files provided in this repository are samples and not intended for production and are not supported.

## Running Sample
Follow these steps to run the sample app:
1. Install the [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) runtime or SDK.
1. Install the [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) runtime or SDK.
2. Unzip the DoorDashAPIWinFormsApp.zip file in a local folder on a Windows machine.
3. Double click DoorDashAPIWinFormsApp.exe from the uncompressed folder.
4. Provide the DoorDash Credentials (Developer ID, Key ID, and Signing Secret) created in the [DoorDash Developer Portal](https://developer.doordash.com/portal/integration/drive/credentials).
5. Click the "Update JWT" button.

## Build Sample App with the .NET CLI
Follow these steps to build the sample app with the .NET CLI:
1. Install the [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) SDK (includes the .NET CLI).
1. Install the [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) SDK (includes the .NET CLI).
2. Clone this repo to local folder or download and the files in the source folder into a local directory.
3. Open a command window and change the directory to folder that folder that contains the source files
4. Run the following command: ``dotnet build``
5. The application can be run from within the **../bin/Debug/net7.0-windows/** folder.

## Build Sample App with Visual Studio
Follow these steps to build the sample app with Visual Studio:
1. Install the [.NET 7](https://dotnet.microsoft.com/en-us/download/dotnet/7.0) SDK (includes the .NET CLI).
1. Install the [.NET 8](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) SDK (includes the .NET CLI).
2. Install Visual Studio 2022 (Community, Professional, or Enterprise).
3. Clone this repo to local folder or download and the files in the source folder into a local directory.
4. Open the **DoorDashAPIWinFormsApp.csproj** project in Visual Studio.
Expand Down
6 changes: 3 additions & 3 deletions source/DoorDashAPIWinFormsApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net7.0-windows</TargetFramework>
<TargetFramework>net8.0-windows10.0.17763.0</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.25.1" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.25.1" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.5.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.5.0" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions source/JwtCreateForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ private void SetDefaultValues()

private void UpdateJWT()
{
// Do not run update if user provided values are note valid.
// Do not run update if user provided values are not valid.
// Note, function doesn't test if values provided are correct size.
if (!UserProvidedValuesValid())
{
Expand Down Expand Up @@ -128,4 +128,4 @@ private void SigningSecretTextBox_Leave(object sender, EventArgs e)
UpdateJWT();
}
}
}
}