Giter Site home page Giter Site logo

openiddict-ui's Introduction

build NuGet Release

OpenIddict UI

A first step to provide some headless UI features to the OpenIddict stack.

Please note that this project does not provide you a ready to use UI instead provides you the required services that allow you to build one. You can use the samples as a starting point though.

Currently it provides API's for managing Scopes and Applications.

On top of that it ships API's for the Usermanagement when using ASP.NET Core Identity.

As a goodie the samples demonstrates this features by an Angular SPA client that uses the Authorization Code flow.

SPA Client

Running the sample

Assuming you downloaded the sources and opened VS Code in the root repo directory you should be good to go! Ahh and of course you need .NET Core and node.js installed on your development environment.

Running the Server

  1. Open the integrated terminal in VS Code and type
dotnet build

That ensures you are able to build the dotnet related stuff!

  1. Go to the VS Code Debug tab (Ctrl+Shift+D) and run the Server project.

  2. After the Server is running navigate within your favorite command line to the Client directory and type:

npm i

This will install all the Client's required dependencies.

npm run start

This will start Angular's development server.

  1. Now open your browser of choice and point to the well known Angular dev url.
http://localhost:4200

You should see now the login screen. You can now login with the pre-configured administrator users account which is:

Using it

Follow the original setup of the OpenIddict in the Startup.ConfigureServices(...) - method and add the two additional extension hooks AddUIStore(...) and AddUIApis<TIdentityUser>(...) and you should be good to go.

...
services.AddOpenIddict()
  // Register the OpenIddict core components.
  .AddCore(options =>
  {
    ...
  })
  // Register the OpenIddict server components.
  .AddServer(options =>
  {
    ...
  })
  // Register the OpenIddict validation components.
  .AddValidation(options =>
  {
    ...
  })
  // Register the EF based UI Store
  .AddUIStore(options =>
  {
    options.OpenIddictUIContext = builder =>
      builder.UseSqlite(Configuration.GetConnectionString("DefaultConnection"),
        sql => sql.MigrationsAssembly(typeof(Startup)
                  .GetTypeInfo()
                  .Assembly
                  .GetName()
                  .Name));
  })
  // Register the API for the EF and ASP.NET Identity based UI Store
  .AddUIApis<ApplicationUser>(new OpenIddictUIApiOptions
  {
    // Tell the system about the allowed Permissions it is built/configured for.
    Permissions =
    {
      Permissions.Endpoints.Authorization,
      Permissions.Endpoints.Logout,
      Permissions.Endpoints.Token,
      Permissions.GrantTypes.AuthorizationCode,
      Permissions.GrantTypes.Password,
      Permissions.GrantTypes.RefreshToken,
      Permissions.ResponseTypes.Code,
      Permissions.Scopes.Email,
      Permissions.Scopes.Profile,
      Permissions.Scopes.Roles,
      Permissions.Prefixes.Scope + "demo_api"
    }
  });
  
...

Thoughts and ideas

The project is still very young and there are a lot of ideas like:

  • Separating the ASP.NET Core Identity API's from the OpenIddict API's.
  • Provide API's for the Authorization and Token entities (if then really required).
  • Provide a ASP.NET Razor Page based UI.
  • Possibility to manage translated display names based on supported languages etc.

openiddict-ui's People

Contributors

thomasduft avatar

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.