diff --git a/_contentTemplates/common/get-started.md b/_contentTemplates/common/get-started.md index eeb3892e8..4dd17d011 100644 --- a/_contentTemplates/common/get-started.md +++ b/_contentTemplates/common/get-started.md @@ -21,11 +21,40 @@ #end +#generate-nuget-api-key + +As the Telerik NuGet server requires authentication, the first step is to obtain an API key that you will use instead of a password. Using an API key instead of a password is a more secure approach, especially when working with [.NET CLI](#use-the-net-cli) or the [`NuGet.Config` file](#edit-the-nugetconfig-file). + +1. Go to the [NuGet Keys](https://www.telerik.com/account/downloads/nuget-keys) page in your Telerik account. +1. Click **Generate New Key +**. +1. In the **Key Note** field, add a note that describes the API key. +1. Click **Generate Key**. +1. Select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **NuGet Keys** page displays only a portion of the key. +1. Store the generated NuGet API key as you will need it in the next steps. + +Whenever you need to authenticate your system with the Telerik NuGet server, use `api-key` as the username and your generated API key as the password. +#end #add-nuget-feed ## Step 3: Add the Telerik NuGet Feed to Visual Studio -In this tutorial, you will use the [Telerik NuGet feed](slug:installation/nuget) to download the UI for Blazor components. This NuGet feed is private and requires you to authenticate with your Telerik user name and password: +In this tutorial, you will use the [Telerik NuGet feed](slug:installation/nuget) to download the UI for Blazor components. This NuGet feed is private and requires you to authenticate with a NuGet API key. + +To generate your NuGet API key: + +1. Go to the [NuGet Keys](https://www.telerik.com/account/downloads/nuget-keys) page in your Telerik account. + +1. Click **Generate New Key +**. + +1. In the **Key Note** field, add a note that describes the API key. + +1. Click **Generate Key**. + +1. Select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **NuGet Keys** page displays only a portion of the key. + +1. Store the generated NuGet API key as you will need it in the next steps. + +Next, add the Telerik NuGet feed to Visual Studio: 1. In Visual Studio and go to **Tools** > **NuGet Package Manager** > **Package Manager Settings**. @@ -37,9 +66,9 @@ In this tutorial, you will use the [Telerik NuGet feed](slug:installation/nuget) ![Add the Telerik NuGet Feed in Visual Studio](images/telerik-nuget-feed.png) -1. Whenever Visual Studio displays a dialog to enter credentials for `nuget.telerik.com`, use your Telerik account email and password. +1. Whenever Visual Studio displays a dialog to enter credentials for `nuget.telerik.com`, use `api-key` as the username and your NuGet API key as the password. ->tip For alternative NuGet package download options, check the [Workflow article](slug:getting-started/what-you-need). You can also [authenticate with `nuget.telerik.com` with an API key](slug:installation/nuget#use-nuget-api-key). +>tip For alternative NuGet package download options, check the [Workflow article](slug:getting-started/what-you-need). #end diff --git a/deployment/nuget-keys.md b/deployment/nuget-keys.md index 0c06780f6..a1334793f 100644 --- a/deployment/nuget-keys.md +++ b/deployment/nuget-keys.md @@ -10,32 +10,15 @@ position: 10 This article describes how to use token-based authentication for the Telerik NuGet feed. You will learn how to create and use NuGet API keys to restore Telerik NuGet packages in your Continuous Integration (CI) workflow. -The [Telerik NuGet server](slug:installation/nuget) provides two ways to authenticate: - -* Basic authentication with your Telerik username and password. -* Token-based authentication with a NuGet API key. - -When you need to restore the [Telerik NuGet packages](slug:getting-started/what-you-need#nuget-packages) as part of your CI, a NuGet API key is the more secure way to authenticate. This method does not require you to provide your Telerik credentials anywhere in the CI workflow. A NuGet Key has a limited scope and can be used only with the Telerik NuGet server. If any of your NuGet keys is compromised, you can quickly delete it and create a new one. - +When you need to restore the [Telerik NuGet packages](slug:getting-started/what-you-need#nuget-packages) as part of your CI, using NuGet keys provides a secure way to authenticate. This method does not require you to provide your Telerik credentials anywhere in the CI workflow. A NuGet Key has a limited scope and can be used only with the Telerik NuGet server. If any of your NuGet keys is compromised, you can quickly delete it and create a new one. ## Generating NuGet Keys -1. In your Telerik account, go to the [**Manage NuGet Keys**](https://www.telerik.com/account/downloads/nuget-keys) page. - - ![Manage NuGet Keys](../deployment/images/manage-nuget-keys.png) - -1. Click **Generate New Key**. - -1. Enter a name for the NuGet Key and click **Generate Key**. - -1. To copy the key, click **Copy and Close**. Once you close the popup dialog, you can no longer copy the generated key. For security reasons, the **NuGet Keys** page displays only a portion of the key. - - ![Copy Generated NuGet Key](../deployment/images/copy-nuget-key.png) - +@[template](/_contentTemplates/common/get-started.md#generate-nuget-api-key) ## Storing NuGet Keys ->warning Never check in Telerik account credentials or a NuGet API key with your source code or leave them publicly visible in plain text (for example, in a `NuGet.Config` file). A NuGet key is valuable and bad actors can use it to access the NuGet packages that are licensed under your account. A key abuse can lead to a review of the affected Telerik account. +>warning Never check in a NuGet API key with your source code or leave them publicly visible in plain text (for example, in a `NuGet.Config` file). A NuGet key is valuable and bad actors can use it to access the NuGet packages that are licensed under your account. A key abuse can lead to a review of the affected Telerik account. To protect the NuGet Key, store it as a secret environment variable. The exact store steps depend on your workflow and environment: diff --git a/getting-started/client-blazor.md b/getting-started/client-blazor.md index 44a9c688f..79619205b 100644 --- a/getting-started/client-blazor.md +++ b/getting-started/client-blazor.md @@ -48,7 +48,7 @@ This article explains how to get the \ ---password \ +--username api-key \ +--password \ --store-password-in-clear-text ```` -### Store Encrypted Credentials - -The .NET CLI supports NuGet password encryption only on the Windows platform. Note that [the encrypted password in the `NuGet.Config` file will work only for one user and one machine](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file#packagesourcecredentials). - -If you [add the Telerik package source in Visual Studio](#use-visual-studio), the credentials will be encrypted and stored in the Windows Credential Manager on Windows and in the Keychain on macOS. - -You can read more about the options provided by the NuGet tooling in the packageSourceCredentials section of the NuGet.Config reference article by Microsoft. Note the difference between the `password` and `cleartextpassword` options. - - ## Edit the NuGet.Config File NuGet package sources and other settings are stored in a `NuGet.Config` file. You can read more about the file structure in the Microsoft article [NuGet.Config Reference](https://learn.microsoft.com/en-us/nuget/reference/nuget-config-file). @@ -106,7 +101,7 @@ To edit a `NuGet.Config` file and add the Telerik feed, you need to: 1. Ensure you are editing the [correct and desired config file](https://learn.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses). You can also create a new one with the [`dotnet new nugetconfig` command](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-new). -2. Add the Telerik package source to the config file. Use plain text credentials, because the .NET Core NuGet tooling does not fully support encrypted credentials. Here is an example of how your `NuGet.Config` file can look like: +2. Add the Telerik package source to the config file. For the authentication, use your [NuGet API key](#generate-a-nuget-api-key) as a password and `api-key` as a username. Here is an example of how your `NuGet.Config` file can look like: ````XML.skip-repl @@ -119,25 +114,13 @@ To edit a `NuGet.Config` file and add the Telerik feed, you need to: - - + + ```` -## Use NuGet API Key - -There are two ways to authenticate with the Telerik NuGet server when you add the Telerik NuGet source [with the .NET CLI](#use-the-net-cli) or [edit the `NuGet.Config` file manually](#edit-the-nuget-config-file): - -* Use your Telerik account email as the username, and your Telerik password. -* Use `api-key` as the username and your personal [NuGet API Key](slug:deployment-nuget) as the password. - -You can [generate your Telerik NuGet API Key on telerik.com](https://www.telerik.com/account/downloads/nuget-keys). Read more about [using NuGet API Keys in different environments](slug:deployment-nuget). - -> Always use the NuGet API Key in plain text. - - ## Package Source Mapping The `Telerik.UI.for.Blazor` NuGet package and most of its dependencies reside on `nuget.telerik.com`. On the other hand, the [Telerik icon packages](slug:common-features-icons) and the [`Telerik.Licensing` package](slug:installation-license-key) reside on `nuget.org`. The correct [package source mapping](https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping) configuration should be similar to the one below. @@ -173,7 +156,6 @@ The `Telerik.UI.for.Blazor` NuGet package and most of its dependencies reside on ```` - ## Access NuGet Packages behind Firewall To access the Telerik NuGet feed behind a firewall that restricts outgoing requests, you may need to allow the following domains: @@ -183,12 +165,6 @@ To access the Telerik NuGet feed behind a firewall that restricts outgoing reque The firewall must allow some of the requests to be redirected from `nuget.telerik.com` to `downloads.cdn.telerik.com`. - -## Obsolete Telerik NuGet URL - -The NuGet v2 server at `https://nuget.telerik.com/nuget` was sunset in November 2024 and is no longer available. The v3 protocol offers faster package searches and restores, improved security, and more reliable infrastructure. To redirect your feed to the NuGet v3 protocol, all you have to do is to change your NuGet package source URL to `https://nuget.telerik.com/v3/index.json`. - - ## Troubleshooting See the [NuGet Troubleshooting](slug:troubleshooting-nuget) article for tips about common pitfalls when working with the Telerik NuGet feed.