Skip to content

Commit 60e3c1f

Browse files
github-actions[bot]yordan-mitevdimodi
authored
Merge use-nuget-api-key-as-primary-auth-3223 into production (#3306)
* Remove NuGet authentication with password option * Address feedback from review * Apply new naming and update URL * Apply suggestion from @dimodi Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Apply suggestion from @dimodi Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Apply suggestion from @dimodi Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Apply suggestion from @dimodi Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * Apply suggestion from @dimodi Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com> * address comments --------- Co-authored-by: Yordan Mitev <yordan.mitev@progress.com> Co-authored-by: Yordan <60105689+yordan-mitev@users.noreply.github.com> Co-authored-by: Dimo Dimov <961014+dimodi@users.noreply.github.com>
1 parent a2bf5ef commit 60e3c1f

File tree

7 files changed

+80
-90
lines changed

7 files changed

+80
-90
lines changed

_contentTemplates/common/get-started.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,40 @@
2121
2222
#end
2323

24+
#generate-nuget-api-key
25+
26+
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 the [.NET CLI](#use-the-net-cli) or a [`NuGet.Config` file](#edit-the-nugetconfig-file).
27+
28+
1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-keys) page in your Telerik account.
29+
1. Click **Generate New Key +**.
30+
1. In the **Key Note** field, add a note that describes the API key.
31+
1. Click **Generate Key**.
32+
1. Select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **API Keys** page displays only a portion of the key.
33+
1. Store the generated NuGet API key as you will need it in the next steps.
34+
35+
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.
36+
#end
2437

2538
#add-nuget-feed
2639
## Step 3: Add the Telerik NuGet Feed to Visual Studio
2740

28-
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:
41+
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.
42+
43+
To generate your NuGet API key:
44+
45+
1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-keys) page in your Telerik account.
46+
47+
1. Click **Generate New Key +**.
48+
49+
1. In the **Key Note** field, add a note that describes the API key.
50+
51+
1. Click **Generate Key**.
52+
53+
1. Select **Copy and Close**. Once you close the window, you can no longer copy the generated key. For security reasons, the **API Keys** page displays only a portion of the key.
54+
55+
1. Store the generated NuGet API key as you will need it in the next steps.
56+
57+
Next, add the Telerik NuGet feed to Visual Studio:
2958

3059
1. In Visual Studio and go to **Tools** > **NuGet Package Manager** > **Package Manager Settings**.
3160

@@ -37,9 +66,9 @@ In this tutorial, you will use the [Telerik NuGet feed](slug:installation/nuget)
3766

3867
![Add the Telerik NuGet Feed in Visual Studio](images/telerik-nuget-feed.png)
3968

40-
1. Whenever Visual Studio displays a dialog to enter credentials for `nuget.telerik.com`, use your Telerik account email and password.
69+
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.
4170

42-
>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).
71+
>tip For alternative NuGet package download options, check the [Workflow article](slug:getting-started/what-you-need).
4372
4473
#end
4574

deployment/ci-cd-license-key.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ steps:
124124
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
125125
````
126126

127-
Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the article [Restoring NuGet Packages in Your CI Workflow](slug:deployment-nuget). It shows how to use the `TELERIK_NUGET_KEY` environment variable in your CI build environment.
127+
Also see [Using API Keys](slug:deployment-nuget#using-api-keys) in the article [Restoring NuGet Packages in Your CI Workflow](slug:deployment-nuget). It shows how to use the `TELERIK_NUGET_KEY` environment variable in your CI build environment.
128128

129129
## Docker
130130

deployment/nuget-keys.md

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Restoring NuGet Packages in CI
33
page_title: Restoring NuGet Packages in CI
4-
description: Get started with Telerik UI for Blazor and use NuGet Keys to authenticate with the Telerik NuGet server and restore packages in your CI or desktop environment.
4+
description: Get started with Telerik UI for Blazor and use API Keys to authenticate with the Telerik NuGet server and restore packages in your CI or desktop environment.
55
slug: deployment-nuget
66
position: 10
77
---
@@ -10,52 +10,35 @@ position: 10
1010

1111
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.
1212

13-
The [Telerik NuGet server](slug:installation/nuget) provides two ways to authenticate:
13+
When you need to restore the [Telerik NuGet packages](slug:getting-started/what-you-need#nuget-packages) as part of your CI, using API Keys provides a secure way to authenticate. This method does not require you to provide your Telerik credentials anywhere in the CI workflow. An API key has a limited scope and can be used only with the Telerik NuGet server. If any of your API Keys is compromised, you can quickly delete it and create a new one.
1414

15-
* Basic authentication with your Telerik username and password.
16-
* Token-based authentication with a NuGet API key.
15+
## Generating API Keys
1716

18-
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.
17+
@[template](/_contentTemplates/common/get-started.md#generate-nuget-api-key)
1918

19+
## Storing API Keys
2020

21-
## Generating NuGet Keys
21+
>warning Never check in NuGet API keys with your source code or leave them publicly visible in plain text (for example, in a `NuGet.Config` file). An API 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.
2222
23-
1. In your Telerik account, go to the [**Manage NuGet Keys**](https://www.telerik.com/account/downloads/nuget-keys) page.
24-
25-
![Manage NuGet Keys](../deployment/images/manage-nuget-keys.png)
26-
27-
1. Click **Generate New Key**.
28-
29-
1. Enter a name for the NuGet Key and click **Generate Key**.
30-
31-
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.
32-
33-
![Copy Generated NuGet Key](../deployment/images/copy-nuget-key.png)
34-
35-
36-
## Storing NuGet Keys
37-
38-
>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.
39-
40-
To protect the NuGet Key, store it as a secret environment variable. The exact store steps depend on your workflow and environment:
23+
To protect the API key, store it as a secret environment variable. The exact store steps depend on your workflow and environment:
4124

4225
* In GitHub Actions, save the key as a [GitHub Actions Secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).
43-
* In Azure DevOps, save the key as a [secret Azure DevOps pipeline variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables). If you use an Azure DevOps Service connection instead of secret environment variables, enter `api-key` in the username field and the NuGet key as the password in the **New NuGet service connection** form editor.
26+
* In Azure DevOps, save the key as a [secret Azure DevOps pipeline variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables). If you use an Azure DevOps Service connection instead of secret environment variables, enter `api-key` in the username field and the API key as the password in the **New NuGet service connection** form editor.
4427
* In Docker images, save the key as a [Docker secret](https://docs.docker.com/tags/secrets/).
4528

46-
For more details on storing and protecting your NuGet Key, check the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
29+
For more details on storing and protecting your API key, check the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
4730

4831
The examples below assume that the secret environment variable name is `TELERIK_NUGET_KEY`.
4932

5033

51-
## Using NuGet Keys
34+
## Using API Keys
5235

53-
There are two common ways to use a [stored NuGet key](#storing-nuget-keys) with the Telerik NuGet server during a build:
36+
There are two common ways to use a [stored API key](#storing-api-keys) with the Telerik NuGet server during a build:
5437

55-
* [Using a NuGet.Config file](#using-a-nuget-config-file)
56-
* [Using only CLI commands](#using-net-cli-commands)
38+
* [Use a NuGet.Config file](#using-a-nuget-config-file)
39+
* [Use only CLI commands](#using-net-cli-commands)
5740

58-
For more information on how to use NuGet keys in a build, check the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
41+
For more information on how to use API keys in a build, check the [Announcing NuGet Keys](https://www.telerik.com/blogs/announcing-nuget-keys) blog post by Lance McCarthy.
5942

6043
### Using a NuGet.Config File
6144

@@ -82,7 +65,7 @@ In your `NuGet.Config` file, set the `Username` value to `api-key` and the `Clea
8265

8366
### Using .NET CLI Commands
8467

85-
You can use the .NET CLI `add source` or `update source` commands to set the credentials of a package source. This CLI approach is applicable if your CI system doesn't support [environment variable secrets](#storing-nuget-keys) or if you do not [use a custom `NuGet.Config`](#using-a-nuget-config-file).
68+
You can use the .NET CLI `add source` or `update source` commands to set the credentials of a package source. This CLI approach is applicable if your CI system doesn't support [environment variable secrets](#storing-api-keys) or if you do not [use a custom `NuGet.Config`](#using-a-nuget-config-file).
8669

8770
* To set the credentials in Azure DevOps:
8871

getting-started/client-blazor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ This article explains how to get the <a href = "https://www.telerik.com/blazor-u
4848

4949
2. Install the Telerik Blazor NuGet package:
5050

51-
1. Select the `telerik.com` **Package source** that you [added earlier](#step-3-add-the-telerik-nuget-feed-to-visual-studio). As this is a private NuGet feed, you must authenticate with your [Telerik account](https://www.telerik.com/account/) user name and password.
51+
1. Select the `telerik.com` **Package source** that you [added earlier](#step-3-add-the-telerik-nuget-feed-to-visual-studio). As this is a private NuGet feed, you must authenticate using `api-key` as the username and [your NuGet API key](#step-3-add-the-telerik-nuget-feed-to-visual-studio) as the password.
5252
1. Select the **Browse** tab, find the `Telerik.UI.for.Blazor` NuGet package, and click **Install**.
5353

5454
![Add Telerik Blazor Package to Client Project](images/add-telerik-nuget-to-client-app.png)

getting-started/web-app.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This article explains how to use the Telerik UI for Blazor components in a Blazo
6262

6363
1. Install the Telerik Blazor NuGet package:
6464

65-
1. Select the `telerik.com` **Package source** that you [added earlier](#step-3-add-the-telerik-nuget-feed-to-visual-studio). As this is a private NuGet feed, you must authenticate with your [Telerik account](https://www.telerik.com/account/) username and password.
65+
1. Select the `telerik.com` **Package source** that you [added earlier](#step-3-add-the-telerik-nuget-feed-to-visual-studio). As this is a private NuGet feed, you must authenticate using `api-key` as the username and [your NuGet API key](#step-3-add-the-telerik-nuget-feed-to-visual-studio) as the password.
6666
1. Select the **Browse** tab, find the `Telerik.UI.for.Blazor` NuGet package, and click **Install**.
6767

6868
## Step 5: Enable the Blazor UI Components

0 commit comments

Comments
 (0)