From 52d29aef947d58ddb4d010d1458ea76bbf27140f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Miguel=20Campos?= Date: Thu, 11 Mar 2021 16:00:17 +0000 Subject: [PATCH] Add quickfix for problem with src/Identity (#1201) --- CONTRIBUTING.md | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 379b79194..7d4eefaea 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -174,10 +174,10 @@ This is an example user secrets file for both the Api and Identity projects. "globalSettings": { "selfHosted": true, "identityServer": { - "certificateThumbprint": "" + "certificateThumbprint": "" }, "dataProtection": { - "certificateThumbprint": "" + "certificateThumbprint": "" }, "installation": { "id": "", @@ -190,6 +190,26 @@ This is an example user secrets file for both the Api and Identity projects. } } ``` +### Possible setup error in `src/Identity` + +You may encounter an `Invalid licensing certificate` when running the command `dotnet run` in the project `src/Identity`, like this one: + +```console +info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0] + User profile is available. Using '/Users//.aspnet/DataProtection-Keys' as key repository; keys will not be encrypted at rest. +info: IdentityServer4.Startup[0] + Starting IdentityServer4 version 4.0.4+1b36d1b414f4e0f965af97ab2a7e9dd1b5167bca +crit: Microsoft.AspNetCore.Hosting.Diagnostics[6] + Application startup exception +System.Exception: Invalid licensing certificate. +``` +As a quick fix, navigate to [`src/Core/Services/Implementations/LicensingService.cs`](https://github.com/bitwarden/server/blob/df7a035d9bdbee40e019a596a1a7a66826db02f4/src/Core/Services/Implementations/LicensingService.cs#L49), line 49, and change that line to + +```cs +var certThumbprint = !environment.IsDevelopment() ? "207E64A231E8AA32AAF68A61037C075EBEBD553F" : + "‎B34876439FCDA2846505B2EFBBA6C4A951313EBE"; +``` +⚠️ Do not commit this change, as it might ruin the experience for others. ## Running and Debugging After you have completed the above steps, you should be ready to launch your development environment for the Api and Identity projects. @@ -219,4 +239,4 @@ From within Rider, launch both the Api project and the Identity project by click * If you are using the CLI client, you will also need to set the Node environment variables for your self-signed certificates by following the instructions here: [The Bitwarden command-line tool (CLI) > Self-signed certificates](https://bitwarden.com/help/article/cli/#self-signed-certificates). ### Troubleshooting -* If you get a 404 error, the projects may be listening on a non-default port. Check the output of your running projects to check the port they are listening on. \ No newline at end of file +* If you get a 404 error, the projects may be listening on a non-default port. Check the output of your running projects to check the port they are listening on.