Skip to content

Commit 5fa0d0b

Browse files
Make the API key the primary NuGet auth method (#1876)
* Make the API key the primary NuGet auth method * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Address comments (add tab in front of code snippets) * Apply suggestion from @Copilot Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 2436f68 commit 5fa0d0b

12 files changed

+94
-97
lines changed

getting-started/installation/adding-private-nuget-feed.md

Lines changed: 24 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,23 @@ position: 5
1313

1414
Telerik maintains a publicly accessible NuGet server, providing a collection of NuGet packages to authenticated users. You can add the NuGet feed to your system by using [Visual Studio's NuGet package manager](#setup-in-visual-studio) or the [NuGet CLI](#setup-with-nuget-cli).
1515

16-
To access the NuGet server, you need an active license for Telerik Reporting (trial or commercial).
16+
To access the NuGet server, you need an active license for Telerik Reporting (trial or commercial) and an API key that you will use instead of a password.
17+
18+
## Generate an API Key
19+
20+
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]({% slug using-nuget-keys %}#using-only-cli-commands) or the [`NuGet.Config` file]({% slug using-nuget-keys %}#using-a-nugetconfig-file-with-your-projects).
21+
22+
1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-keys) page in your Telerik account.
23+
1. Click **Generate New Key +**.
24+
25+
![Manage API Keys](./images/account-generate-api-key.png)
26+
27+
1. In the **Key Note** field, add a note that describes the API key.
28+
1. Click **Generate Key**.
29+
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.
30+
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.
31+
32+
>API keys expire after two years. Telerik will send you an email when a key is about to expire, but we recommend that you set your own calendar reminder with information about where you used that key: file paths, project links, AzDO and GitHub Action variable names, and so on.
1733
1834
## Setup in Visual Studio
1935

@@ -28,13 +44,12 @@ To access the NuGet server, you need an active license for Telerik Reporting (tr
2844
1. Create or load your project.
2945
1. Go to __Tools__ > __NuGet Package Manager__ > __Manage NuGet Packages for solution__.
3046
1. In the upper right-hand corner of the __Manage Packages for Solution__ window, select the Telerik __Package source__ that you just added.
31-
1. Depending on your Visual Studio version, choose the __Online__ or __Browse__ list of packages.
32-
1. In the Windows **Authentication** dialog, enter your Telerik credentials. For example, **user: my.name@my.company.com** and **password: myPassPhraseForTelerikDotCom**.
33-
1. Enter your credentials only once by selecting the __Remember my password__ checkbox. You may need to escape some [special characters in the password](#handling-special-characters-in-password).
47+
1. Click the **Browse** tab to see the available packages.
48+
1. In the authentication window, enter `api-key` in the **User name** field and the [generated API key](#generate-an-api-key) in the **Password** field.
3449

3550
>caption Enter your Telerik.com credentials to access the Telerik NuGet feed
3651

37-
![Telerik.com credentials form to access the Telerik NuGet Feed](images/nuget-credentials.png)
52+
![Telerik.com credentials form to access the Telerik NuGet Feed](images/vs-nuget-auth-window.png)
3853

3954
After adding the Telerik server, all packages licensed to the authenticated user become available in the Visual Studio NuGet package manager.
4055

@@ -44,48 +59,22 @@ If you work with Visual Studio Code on Linux or Mac OS, use the Nuget CLI to set
4459

4560
1. Download the latest [NuGet executable](https://dist.nuget.org/win-x86-commandline/latest/nuget.exe).
4661
1. Open a Command Prompt and change the path to the `nuget.exe` location.
47-
1. The command from the example below stores a token in the `%AppData%\NuGet\NuGet.config` file. Your original credentials cannot be obtained from this token.
48-
49-
````powershell
50-
NuGet Sources Add -Name "telerik.com" -Source "https://nuget.telerik.com/v3/index.json" ^
51-
-UserName "your login email" -Password "your password"
52-
````
53-
54-
If you are unable to connect to the feed by using encrypted credentials, store your credentials in clear text.
62+
1. The command from the example below stores your API key in the `%AppData%\NuGet\NuGet.config` file.
5563

5664
````powershell
5765
NuGet Sources Add -Name "telerik.com" -Source "https://nuget.telerik.com/v3/index.json" ^
58-
-UserName "your login email" -Password "your password" ^
66+
-UserName "api-key" -Password "YOUR-API-KEY" ^
5967
-StorePasswordInClearText
6068
````
6169
62-
> Encrypted passwords are only supported on Windows.
63-
64-
If you have already stored a token instead of storing the credentials as clear text, update the definition in the `%AppData%\NuGet\NuGet.config` file by using the following command:
70+
To update expired or invalid login credentials, update the definition in the `%AppData%\NuGet\NuGet.config` file by using the following command:
6571
6672
````powershell
6773
NuGet Sources Update -Name "telerik.com" -Source "https://nuget.telerik.com/v3/index.json" ^
68-
-UserName "your login email" -Password "your password" ^
74+
-UserName "api-key" -Password "YOUR-API-KEY" ^
6975
-StorePasswordInClearText
7076
````
7177

72-
73-
## Handling Special Characters in Password
74-
75-
If your password contains a special character, those characters need to be escaped or it may fail authentication resulting in *Error 401 login failure* from the NuGet server. A common character that needs to be escaped is the ampersand (`&`), but it can be as unique as the section character (`§`). There are two ways to handle this.
76-
77-
1. Change the password so that it only includes characters that do not need to be escaped
78-
1. HTML encodes the password so the special characters are escaped (e.g. `my§uper&P@§§word` becomes `my&sect;uper&amp;P@&sect;&sect;word`).
79-
80-
We strongly discourage entering your password into an online encoder utility, use Powershell instead. Here's one example:
81-
82-
Add-Type -AssemblyName System.Web
83-
[System.Web.HttpUtility]::HtmlEncode('my§uper&P@§§word')
84-
85-
Result:
86-
87-
![Powershell Encoding of a Password containing special characters](images/PowerShellEncodingNugetPassword.png)
88-
8978
## See Also
9079

9180
* [Restoring NuGet Packages in Your CI Workflow]({%slug using-nuget-keys%})
Binary file not shown.
13.3 KB
Loading
-8.27 KB
Binary file not shown.
-18 KB
Binary file not shown.
-19.4 KB
Binary file not shown.
8.27 KB
Loading

getting-started/installation/installation-approaches.md

Lines changed: 37 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ previous_url: /installation-system-requirements, /installation-installing-from-m
1111

1212
# Installation Approaches for Telerik Reporting
1313

14-
Telerik Reporting provides options for installing the product by using [the Control Panel](#using-the-control-panel), by [the MSI installer file](#using-the-msi-file), or [NuGet](#installing-with-nuget). The NuGet packages add the Reporting assemblies to the project, but do not provide design time support.
14+
Telerik Reporting provides options for installing the product by using [the Control Panel](#using-the-control-panel), by [the MSI installer file](#using-the-msi-file), or [NuGet](#using-nuget-packages). The NuGet packages add the Reporting assemblies to the project, but do not provide design time support.
1515

1616
>note After installing the product, you will need to [download and activate/update your Telerik Reporting License Key]({%slug license-key%}).
1717
@@ -70,36 +70,56 @@ To install Telerik Reporting through the MSI automatic installer file:
7070

7171
## Using NuGet Packages
7272

73-
You can add Telerik Reporting to a project by using the [Telerik Reporting NuGet packages](https://nuget.telerik.com/v3/index.json). The NuGet packages are a single ZIP file with the `.nupkg` extension.
73+
You can add Telerik Reporting to a project by installing NuGet packages hosted on the Telerik NuGet server: `https://nuget.telerik.com/v3/index.json`.
7474

7575
* The `.nupkg` file contains the libraries for .NET Core projects, the Reporting Engine, and the implementation of the [Reporting REST WebAPI-based service]({%slug telerikreporting/using-reports-in-applications/host-the-report-engine-remotely/telerik-reporting-rest-services/asp.net-web-api-implementation/overview%}) where you can use the packages with the standard .NET 4.6.1 framework.
7676
* The Telerik Reporting NuGet packages do not include design-time support.
77-
* The legacy https://nuget.telerik.com/nuget server is now deprecated. Make sure to switch to the new https://nuget.telerik.com/v3/index.json server, which is faster, lighter, and reduces the number of requests from your NuGet client. For more information on how to add a NuGet feed, refer to the [official Microsoft documentation](https://www.visualstudio.com/en-us/docs/package/nuget/consume).
7877

79-
### Adding the Telerik NuGet Feed
78+
Installing the Telerik Reporting NuGet packages involves three steps:
8079

81-
To install the Telerik Reporting NuGet packages, add the Telerik NuGet feed to Visual Studio and install the product. The following video demonstrates the steps for adding the Telerik NuGet feed to Visual Studio. If you prefer, however, you can follow the steps that are listed in writing after the video.
80+
1. [Generating an API key required for the NuGet authentication](#step-1-generating-an-api-key).
81+
1. [Adding the Telerik NuGet server to Visual Studio](#step-2-adding-the-telerik-nuget-package-source-to-visual-studio).
82+
1. [Installing the Telerik Reporting NuGet packages](#step-3-installing-telerik-reporting).
8283

83-
<iframe width="560" height="315" src="https://www.youtube.com/embed/c3m_BLMXNDk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
84+
### Step 1: Generating an API Key
8485

85-
To configure the Telerik NuGet Feed in Visual Studio:
86+
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]({% slug using-nuget-keys %}#using-only-cli-commands) or the [`NuGet.Config` file]({% slug using-nuget-keys %}#using-a-nugetconfig-file-with-your-projects).
8687

87-
1. Open Visual Studio and go to **Tools** > **NuGet Package Manager** > **Package Manager Settings**.
88-
1. Select **Package Sources** and then click the `+` button to add a new package source.
89-
1. Enter a **Name** for the new package source, for example, **Telerik NuGet**.
90-
1. Add the `https://nuget.telerik.com/v3/index.json` URL as a **Source**. Make sure the URL does not have a trailing slash. Click **OK**.
88+
1. Go to the [API Keys](https://www.telerik.com/account/downloads/api-keys) page in your Telerik account.
89+
1. Click **Generate New Key +**.
9190

92-
### Installing Telerik Reporting
91+
![Manage API Keys](./images/account-generate-api-key.png)
92+
93+
1. In the **Key Note** field, add a note that describes the API key.
94+
1. Click **Generate Key**.
95+
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.
96+
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.
97+
98+
>API keys expire after two years. Telerik will send you an email when a key is about to expire, but we recommend that you set your own calendar reminder with information about where you used that key: file paths, project links, AzDO and GitHub Action variable names, and so on.
99+
100+
### Step 2: Adding the Telerik NuGet Package Source to Visual Studio
101+
102+
To configure the Telerik NuGet feed in Visual Studio:
103+
104+
1. Open Visual Studio.
105+
1. Go to **Tools > NuGet Package Manager > Package Manager Settings**.
106+
1. Select **Package Sources**, and then click the + button.
107+
1. In the **Source** field, enter `https://nuget.telerik.com/v3/index.json`. If you use a locally available NuGet package downloaded from <a href="https://www.telerik.com/account/" target="_blank">your account</a>, add the path to the local package instead of the URL.
108+
1. Click **Update** and then **OK**.
109+
110+
You have successfully added the Telerik NuGet feed as a Package source.
111+
112+
For more information on how to add a NuGet feed, refer to the [official Microsoft documentation](https://www.visualstudio.com/en-us/docs/package/nuget/consume).
113+
114+
### Step 3: Installing Telerik Reporting
93115

94116
After you have successfully added the Telerik NuGet feed as a package source, you need to authenticate your local NuGet instance and install Telerik Reporting:
95117

96118
1. Create a new Reporting project or open an existing one.
97119
1. Go to **Tools** > **NuGet Package Manager** > **Manage NuGet Packages for Solution...**. Select the Telerik NuGet **Package source** from the drop-down list on the left.
98-
1. Select the **Browse** tab to see the available packages. Enter your Telerik credentials in the Windows Authentication dialog.
99-
100-
> You may need to escape some [special characters in the password]({%slug telerikreporting/using-reports-in-applications/how-to-add-the-telerik-private-nuget-feed-to-visual-studio%}#handling-special-characters-in-password)
101-
102-
1. Select Telerik Reporting and click **Install**.
120+
1. Select the **Browse** tab to see the available packages.
121+
1. In the authentication window, enter `api-key` in the **User name** field and the [generated API key](#step-1-generating-an-api-key) in the **Password** field.
122+
1. Select the desired Telerik Reporting NuGet package and click **Install**.
103123

104124
## See Also
105125

0 commit comments

Comments
 (0)