From 37df0fda479eed8f5fc53255967fd63169191086 Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:53:02 -0400 Subject: [PATCH 1/2] Initialize the Secret Manger tool --- .../blazor/security/blazor-web-app-with-oidc.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md index 5002a4f43a00..423cba718df6 100644 --- a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md +++ b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md @@ -67,7 +67,13 @@ For local development testing, use the [Secret Manager tool](xref:security/app-s > [!NOTE] > If the app uses Microsoft Entra ID or Azure AD B2C, create a client secret in the app's registration in the Entra or Azure portal (**Manage** > **Certificates & secrets** > **New client secret**). Use the **Value** of the new secret in the following guidance. -Execute the following command in a command shell from the server project's directory, such as the Developer PowerShell command shell in Visual Studio. The `{SECRET}` placeholder is the client secret obtained from the app's registration: +The [sample app](#sample-app) hasn't been initialized for the Secret Manager tool. Execute the following command in a command shell from the server project's directory, such as the Developer PowerShell command shell in Visual Studio. The command establishes a user secrets identifier (`` in the app's project file): + +```dotnetcli +dotnet user-secrets init +``` + +Execute the following command to set the client secret. The `{SECRET}` placeholder is the client secret obtained from the app's registration: ```dotnetcli dotnet user-secrets set "Authentication:Schemes:MicrosoftOidc:ClientSecret" "{SECRET}" @@ -323,7 +329,13 @@ For local development testing, use the [Secret Manager tool](xref:security/app-s > [!NOTE] > If the app uses Microsoft Entra ID or Azure AD B2C, create a client secret in the app's registration in the Entra or Azure portal (**Manage** > **Certificates & secrets** > **New client secret**). Use the **Value** of the new secret in the following guidance. -Execute the following command in a command shell from the server project's directory, such as the Developer PowerShell command shell in Visual Studio. The `{SECRET}` placeholder is the client secret obtained from the app's registration: +The [sample app](#sample-app) hasn't been initialized for the Secret Manager tool. Execute the following command in a command shell from the server project's directory, such as the Developer PowerShell command shell in Visual Studio. The command establishes a user secrets identifier (`` in the app's project file): + +```dotnetcli +dotnet user-secrets init +``` + +Execute the following command to set the client secret. The `{SECRET}` placeholder is the client secret obtained from the app's registration: ```dotnetcli dotnet user-secrets set "Authentication:Schemes:MicrosoftOidc:ClientSecret" "{SECRET}" From 4da04b82c3e1dfa626d1f199bfa5cff3e4021dcd Mon Sep 17 00:00:00 2001 From: Luke Latham <1622880+guardrex@users.noreply.github.com> Date: Mon, 28 Oct 2024 10:57:04 -0400 Subject: [PATCH 2/2] Updates --- aspnetcore/blazor/security/blazor-web-app-with-oidc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md index 423cba718df6..d70c9b4094db 100644 --- a/aspnetcore/blazor/security/blazor-web-app-with-oidc.md +++ b/aspnetcore/blazor/security/blazor-web-app-with-oidc.md @@ -67,7 +67,7 @@ For local development testing, use the [Secret Manager tool](xref:security/app-s > [!NOTE] > If the app uses Microsoft Entra ID or Azure AD B2C, create a client secret in the app's registration in the Entra or Azure portal (**Manage** > **Certificates & secrets** > **New client secret**). Use the **Value** of the new secret in the following guidance. -The [sample app](#sample-app) hasn't been initialized for the Secret Manager tool. Execute the following command in a command shell from the server project's directory, such as the Developer PowerShell command shell in Visual Studio. The command establishes a user secrets identifier (`` in the app's project file): +The [sample app](#sample-app) hasn't been initialized for the Secret Manager tool. Use a command shell, such as the Developer PowerShell command shell in Visual Studio, to execute the following command. Before executing the command, change the directory with the `cd` command to the server project's directory. The command establishes a user secrets identifier (`` in the server app's project file): ```dotnetcli dotnet user-secrets init @@ -329,7 +329,7 @@ For local development testing, use the [Secret Manager tool](xref:security/app-s > [!NOTE] > If the app uses Microsoft Entra ID or Azure AD B2C, create a client secret in the app's registration in the Entra or Azure portal (**Manage** > **Certificates & secrets** > **New client secret**). Use the **Value** of the new secret in the following guidance. -The [sample app](#sample-app) hasn't been initialized for the Secret Manager tool. Execute the following command in a command shell from the server project's directory, such as the Developer PowerShell command shell in Visual Studio. The command establishes a user secrets identifier (`` in the app's project file): +The [sample app](#sample-app) hasn't been initialized for the Secret Manager tool. Use a command shell, such as the Developer PowerShell command shell in Visual Studio, to execute the following command. Before executing the command, change the directory with the `cd` command to the server project's directory. The command establishes a user secrets identifier (`` in the server app's project file): ```dotnetcli dotnet user-secrets init