Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/auth0/auth0.net

.NET client for the Auth0 Authentication & Management APIs.
https://github.com/auth0/auth0.net

dx-sdk oauth2 openid-connect

Last synced: about 2 months ago
JSON representation

.NET client for the Auth0 Authentication & Management APIs.

Lists

README

        

![.NET client for Auth0 Authentication and Management APIs](https://cdn.auth0.com/website/sdks/banners/auth0-net-banner.png)

![Release](https://img.shields.io/github/v/release/auth0/auth0.net)
![Downloads](https://img.shields.io/nuget/dt/auth0.core)
[![License](https://img.shields.io/:license-MIT-blue.svg?style=flat)](https://opensource.org/licenses/MIT)
![AzureDevOps](https://img.shields.io/azure-devops/build/Auth0SDK/Auth0.Net/6)

:books: [Documentation](#documentation) - :rocket: [Getting Started](#getting-started) - :computer: [API Reference](https://auth0.github.io/auth0.net/) - :speech_balloon: [Feedback](#feedback)

## Documentation

- [Docs site](https://www.auth0.com/docs) - explore our docs site and learn more about Auth0.

## Getting started

### Requirements
This library supports .NET Standard 2.0 and .NET Framework 4.5.2 as well as later versions of both.

### Management API

#### Installation

```powershell
Install-Package Auth0.ManagementApi
```

#### Usage

Generate a token for the API calls you wish to make (see [Access Tokens for the Management API](https://auth0.com/docs/api/management/v2/tokens)). Create an instance of the `ManagementApiClient` class with the token and the API URL of your Auth0 instance:

```csharp
var client = new ManagementApiClient("your token", new Uri("https://YOUR_AUTH0_DOMAIN/api/v2"));
```

The API calls are divided into groups which correlate to the [Management API documentation](https://auth0.com/docs/api/v2). For example all Connection related methods can be found under the `ManagementApiClient.Connections` property. So to get a list of all database (Auth0) connections, you can make the following API call:

```csharp
await client.Connections.GetAllAsync("auth0");
```

### Authentication API

#### Installation

```powershell
Install-Package Auth0.AuthenticationApi
```

#### Usage

To use the Authentication API, create a new instance of the `AuthenticationApiClient` class, passing in the URL of your Auth0 instance, e.g.:

```csharp
var client = new AuthenticationApiClient(new Uri("https://YOUR_AUTH0_DOMAIN"));
```

#### Authentication

This library contains [URL Builders](https://auth0.github.io/auth0.net/#using-url-builders) which will assist you with constructing an authentication URL, but does not actually handle the authentication/authorization flow for you. It is suggested that you refer to the [Quickstart tutorials](https://auth0.com/docs/quickstarts) for guidance on how to implement authentication for your specific platform.

**Important note on state validation**: If you choose to use the [AuthorizationUrlBuilder](https://auth0.github.io/auth0.net/api/Auth0.AuthenticationApi.Builders.AuthorizationUrlBuilder.html) to construct the authorization URL and implement a login flow callback yourself, it is important to generate and store a state value (using [WithState](https://auth0.github.io/auth0.net/api/Auth0.AuthenticationApi.Builders.AuthorizationUrlBuilder.html#Auth0_AuthenticationApi_Builders_AuthorizationUrlBuilder_WithState_System_String_)) and validate it in your callback URL before exchanging the authorization code for the tokens.

## Feedback

### Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see the following:

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)

### Raise an issue

To provide feedback or report a bug, please [raise an issue on our issue tracker](https://github.com/auth0/auth0.net/issues).

### Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/responsible-disclosure-policy) details the procedure for disclosing security issues.

---





Auth0 Logo


Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout Why Auth0?



This project is licensed under the MIT license. See the LICENSE file for more info.