openiddict / openiddict-samples

.NET samples for OpenIddict

Home Page:https://documentation.openiddict.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sample that supports multiple grants

gregsdennis opened this issue · comments

Is your feature request related to a problem?

The samples provided all show how to implement a single grant type. It would be nice to have an example that allows multiple grant types, for example client credentials and resource owner password creds.

Additional context

Given that the consumer has to provide their own controller (as opposed to token requests being handled in a middleware (like in AspNet.Security.OpenIdConnect.Server), I expect that we also have to implement our own application architecture for handling the different grants. I'd like to see a suggested architecture for handling this (something more than an if-then tree or switch).

Given that the consumer has to provide their own controller (as opposed to token requests being handled in a middleware (like in AspNet.Security.OpenIdConnect.Server)

While most samples use the pass-through mode to handle requests in a MVC controller, it's not mandatory. See https://kevinchalet.com/2020/02/18/creating-an-openid-connect-server-proxy-with-openiddict-3-0-s-degraded-mode/ and https://github.com/openiddict/openiddict-samples/blob/dev/samples/Kalarba/Kalarba.Server/Startup.cs for an example using the events model.

Thanks. We'll look into that.