Skip to content
Merged
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
35 changes: 32 additions & 3 deletions _contentTemplates/common/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 the [.NET CLI](#use-the-net-cli) or a [`NuGet.Config` file](#edit-the-nugetconfig-file).

1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-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 **API 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 [API Keys](https://www.telerik.com/account/downloads/api-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 **API 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**.

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion deployment/ci-cd-license-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ steps:
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
````

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

## Docker

Expand Down
47 changes: 15 additions & 32 deletions deployment/nuget-keys.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Restoring NuGet Packages in CI
page_title: Restoring NuGet Packages in CI
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.
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.
slug: deployment-nuget
position: 10
---
Expand All @@ -10,52 +10,35 @@ 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:
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.

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

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

## Storing API Keys

## Generating NuGet Keys
>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.

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)


## 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.

To protect the NuGet Key, store it as a secret environment variable. The exact store steps depend on your workflow and environment:
To protect the API key, store it as a secret environment variable. The exact store steps depend on your workflow and environment:

* In GitHub Actions, save the key as a [GitHub Actions Secret](https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions).
* 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.
* 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.
* In Docker images, save the key as a [Docker secret](https://docs.docker.com/tags/secrets/).

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

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


## Using NuGet Keys
## Using API Keys

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

* [Using a NuGet.Config file](#using-a-nuget-config-file)
* [Using only CLI commands](#using-net-cli-commands)
* [Use a NuGet.Config file](#using-a-nuget-config-file)
* [Use only CLI commands](#using-net-cli-commands)

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

### Using a NuGet.Config File

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

### Using .NET CLI Commands

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).
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).

* To set the credentials in Azure DevOps:

Expand Down
2 changes: 1 addition & 1 deletion getting-started/client-blazor.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This article explains how to get the <a href = "https://www.telerik.com/blazor-u

2. Install the Telerik Blazor NuGet package:

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.
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.
1. Select the **Browse** tab, find the `Telerik.UI.for.Blazor` NuGet package, and click **Install**.

![Add Telerik Blazor Package to Client Project](images/add-telerik-nuget-to-client-app.png)
Expand Down
2 changes: 1 addition & 1 deletion getting-started/web-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This article explains how to use the Telerik UI for Blazor components in a Blazo

1. Install the Telerik Blazor NuGet package:

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.
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.
1. Select the **Browse** tab, find the `Telerik.UI.for.Blazor` NuGet package, and click **Install**.

## Step 5: Enable the Blazor UI Components
Expand Down
Loading