SharpGrip.OpenIddict.Api 1.0.0-alpha1

.NET Standard 2.0
This is a prerelease version of SharpGrip.OpenIddict.Api.
dotnet add package SharpGrip.OpenIddict.Api --version 1.0.0-alpha1
NuGet\Install-Package SharpGrip.OpenIddict.Api -Version 1.0.0-alpha1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpGrip.OpenIddict.Api" Version="1.0.0-alpha1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add SharpGrip.OpenIddict.Api --version 1.0.0-alpha1
#r "nuget: SharpGrip.OpenIddict.Api, 1.0.0-alpha1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install SharpGrip.OpenIddict.Api as a Cake Addin
#addin nuget:?package=SharpGrip.OpenIddict.Api&version=1.0.0-alpha1&prerelease

// Install SharpGrip.OpenIddict.Api as a Cake Tool
#tool nuget:?package=SharpGrip.OpenIddict.Api&version=1.0.0-alpha1&prerelease

SharpGrip OpenIddict API NuGet

Builds

OpenIddict.Api [Build]

Quality Gate Status
Maintainability Rating
Reliability Rating
Security Rating
Coverage

Introduction

SharpGrip OpenIddict API is an extension of the OpenIddict library exposing the OpenIddict entities through a RESTful API.

Installation

Reference NuGet package SharpGrip.OpenIddict.Api (https://www.nuget.org/packages/SharpGrip.OpenIddict.Api).

Follow the OpenIddict installation guide Getting started and call the AddApi<TKey> extension method on the OpenIddictEntityFrameworkCoreBuilder.

serviceCollection.AddOpenIddict().AddCore(options =>
{
    options.UseEntityFrameworkCore()
        .UseDbContext<ApplicationDbContext>()
        .AddApi<long>();
});

Configuration

In case you are overriding the OpenIddict entities you need to use the AddApi<TApplication, TAuthorization, TScope, TToken, TKey> overload to make sure the API is working with the correct entity types.

Both AddApi extension methods expose an options builder with which you can configure your API. In the example below the Application API route will become /open-id-api/application and the endpoints exposed in that route will require an access token with the my_application_access_scope scope.

serviceCollection.AddOpenIddict().AddCore(options =>
{
    options.UseEntityFrameworkCore()
        .UseDbContext<ApplicationDbContext>()
        .AddApi<OpenIdApplication, OpenIdAuthorization, OpenIdScope, OpenIdToken, long>(apiOptions =>
        {
            apiOptions.ApiRoutePrefix = "open-id-api";
            apiOptions.ApplicationApiRoute = "application";
            apiOptions.ApplicationApiAccessScope = "my_application_access_scope";
        });
});

Properties

Property Default value Description
ApiRoutePrefix api/open-id The prefix used in all the API routes.
ApplicationApiRoute application The Application API route.
ApplicationApiAccessScope open_id_application_api_access The access scope needed to access the Application endpoints.
AuthorizationApiRoute authorization The Authorization API route.
AuthorizationApiAccessScope open_id_authorization_api_access The access scope needed to access the Authorization endpoints.
ScopeApiRoute scope The Scope API route.
ScopeApiAccessScope open_id_scope_api_access The access scope needed to access the Scope endpoints.
TokenApiRoute token The Token API route.
TokenApiAccessScope open_id_token_api_access The access scope needed to access the Token endpoints.

Supported operations

Please find below an overview of the supported operations using the default route configuration.

Application

Method Endpoint Description
GET api/open-id/application Returns all applications.
GET api/open-id/application/{id} Returns an application by ID.
POST api/open-id/application Creates an application.
PUT api/open-id/application/{id} Updates an application by ID.
DELETE api/open-id/application/{id} Deletes an application by ID.

Authorization

Method Endpoint Description
GET api/open-id/authorization Returns all authorizations.
GET api/open-id/application/{id} Returns an authorization by ID.

Scope

Method Endpoint Description
GET api/open-id/scope Returns all scopes.
GET api/open-id/scope/{id} Returns a scope by ID.
POST api/open-id/scope Creates a scope.
PUT api/open-id/scope/{id} Updates a scope by ID.
DELETE api/open-id/scope/{id} Deletes a scope by ID.

Token

Method Endpoint Description
GET api/open-id/token Returns all tokens.
GET api/open-id/token/{id} Returns a token by ID.
Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows net7.0 net7.0-android net7.0-ios net7.0-maccatalyst net7.0-macos net7.0-tvos net7.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.0-alpha1 214 10/7/2022