GithubHelp home page GithubHelp logo

sharpgrip / openiddict.api Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 1.0 38 KB

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

Home Page: https://sharpgrip.net

License: MIT License

C# 100.00%
api csharp openiddict sharpgrip

openiddict.api's Introduction

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>(apiConfiguration =>
        {
            apiConfiguration.ApiRoutePrefix = "open-id-api";
            apiConfiguration.ApplicationApiRoute = "application";
            apiConfiguration.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 Parameters
GET api/open-id/application Returns all applications.
GET api/open-id/application/{id} Returns an application by ID. string id
POST api/open-id/application Creates an application. ApplicationCreateModel
PUT api/open-id/application/{id} Updates an application by ID. string id & ApplicationUpdateModel
DELETE api/open-id/application/{id} Deletes an application by ID. string id

Authorization

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

Scope

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

Token

Method Endpoint Description Parameters
GET api/open-id/token Returns all tokens.
GET api/open-id/token/{id} Returns a token by ID. string id

openiddict.api's People

Contributors

mvdgun avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jazeem-azeez

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.