Setting Up the Telerik NuGet Source in NuGet.Config
An alternative way to configure your system to use the Telerik NuGet server is to directly edit the nuget.config
file. This approach is useful if you don't have Visual Studio installed.
To configure the Telerik NuGet server as a package source directly in the nuget.config
file, perform the following steps:
Generate a NuGet Key
Generate a NuGet API key that you will use for the authentication by the Telerik NuGet server. This approach is more secure than using your Telerik credentials in plain text.
Go to the Manage NuGet Keys page in your Telerik account.
-
Select the DOWNLOADS tab and then Manage NuGet Keys.
To create a new key, select the Generate New Key button.
Enter a name for the NuGet Key, and then select Generate Key.
-
To copy the key, 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.
Store the generated NuGet API key as you will need it in the next step.
Edit the NuGet.Config File
-
Go to the
NuGet.Config
file:- On Windows, open the
%AppData%\NuGet\NuGet.Config
file. - On Mac, open either the
~/.config/NuGet/NuGet.Config
or~/.nuget/NuGet/NuGet.Config
file (varies by tooling).
If the file doesn't exist on your machine, create it by running the
dotnet new nugetconfig
command in the terminal. For more information about the command, see Microsoft's docs. - On Windows, open the
In the
nuget.config
file, add the Telerik feed by inserting the line<add key="MyTelerikFeed" value="https://nuget.telerik.com/v3/index.json" protocolVersion="3"/>
in thepackageSources
section.-
In the
packageSourceCredentials
section, add the generated NuGet API key. Useapi-key
as a value for the user name.<configuration> <packageSources> <clear/> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" /> <add key="MyTelerikFeed" value="https://nuget.telerik.com/v3/index.json" protocolVersion="3"/> </packageSources> <packageSourceCredentials> <MyTelerikFeed> <add key="Username" value="api-key" /> <add key="ClearTextPassword" value="%MY_API_KEY%" /> </MyTelerikFeed> </packageSourceCredentials> </configuration> ```
Securing Your Credentials
This article does not cover the scenario of using your Telerik account credentials as plain text in the
NuGet.Config
file due to security concerns. However, you can still use the plain text approach if you must.- Never hard-code Telerik account credentials or NuGet API keys in a
NuGet.Config
file in a GitHub repository, Docker image, or any location that may be accessed by unauthorized parties. A NuGet key is valuable and bad actors can use it to access the NuGet packages that are licensed under your account. A credentials abuse can lead to a review of the affected Telerik account. - If you use single sign-on (SSO) to login into your Telerik account, always use a NuGet API key instead of plain text credentials in the
NuGet.Config
file.
For more details about the
NuGet.Config
file, see the following Microsoft resources:See Also
- Never hard-code Telerik account credentials or NuGet API keys in a