openiddict-core | versatile OAuth 2.0/OpenID Connect stack | OAuth library
kandi X-RAY | openiddict-core Summary
kandi X-RAY | openiddict-core Summary
OpenIddict aims at providing a versatile solution to implement an OpenID Connect server and token validation in any ASP.NET Core 2.1, 3.1 and 5.0 application, and starting in OpenIddict 3.0, any ASP.NET 4.x application using Microsoft.Owin too. OpenIddict fully supports the code/implicit/hybrid flows, the client credentials/resource owner password grants and the device authorization flow. You can also create your own custom grant types. OpenIddict natively supports Entity Framework Core, Entity Framework 6 and MongoDB out-of-the-box, but you can also provide your own stores.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of openiddict-core
openiddict-core Key Features
openiddict-core Examples and Code Snippets
Community Discussions
Trending Discussions on openiddict-core
QUESTION
OpenIddict v3.0.3
When rows are added to the table OpenIddictAuthorizations, the column CreationDate is never populated.
Refering to model class OpenIddictEntityFrameworkAuthorization.CreationDate.
What could be missing? Any hint is appreciated.
Our implementation of OpenIddict has been upgraded during development when OpenIddict has been updated, so something may be missed along the road.
...ANSWER
Answered 2021-Apr-25 at 14:05You can attach the creation date to the descriptor when using the overload accepting an OpenIddictAuthorizationDescriptor
instance.
That said, I opened https://github.com/openiddict/openiddict-core/issues/1247 to update the other overload to populate the creation date automatically.
QUESTION
I am using Openidict.
I am trying to return custom message with custom status code, but I am unable to do it. My configuration in startup.cs
:
ANSWER
Answered 2018-Feb-11 at 20:25It's important to note that both the aspnet-contrib OAuth2 validation and the MSFT JWT handler automatically return a WWW-Authenticate
response header containing an error code/description when a 401 response is returned:
If you think the standard behavior is not convenient enough, you can use the events model to manually handle the challenge. E.g:
QUESTION
I'm trying out OpenIddict 3.0 for use in a SSO app. I followed the steps in the documentation, created an Authorize controller, and added a test application. When I try to connect to authorize I get this exception:
System.InvalidOperationException: The authorization request was not handled. To handle authorization requests, create a class implementing 'IOpenIddictServerHandler' and register it using 'services.AddOpenIddict().AddServer().AddEventHandler()'.
Alternatively, enable the pass-through mode to handle them at a later stage.
I can't find anything in the documentation or sample apps that explains what this means. What am I missing?
Here's my code so far. In Startup.cs
:
ANSWER
Answered 2020-Jan-10 at 02:26To handle authorization requests in a MVC controller, you must tell OpenIddict's ASP.NET Core host to use the pass-through mode, exactly like what you did for the token endpoint:
QUESTION
So, I'm trying to implement OpenIddict version 1.0.0-beta2-0580
with NET core 1.1
and I get the following error:
An unhandled exception occurred while processing the request
This is based on this : https://github.com/openiddict/openiddict-core/tree/dev/samples
The db registers the database correctly, the settings is loaded and everything works here. The tables in the db: __efmigrationshistory
, aspnetroleclaims
, aspnetroles
, aspnetuserclaims
, aspnetuserlogins
, aspnetuserroles
, aspnetusers
, aspnetusertokens
, basetransaction
, openiddictapplications
, openiddictauthorizations
, openiddictscopes
, openiddicttokens
And then I have the following stack trace :
...ANSWER
Answered 2017-Jun-30 at 11:36The error you're seeing is caused by the fact your ClaimsPrincipal
doesn't have the mandatory sub
claim, as indicated by the exception message.
To fix that, you have two options: manually adding the sub
claim or asking Identity to use sub
as the name identifier claim.
Add the sub
claims to the principal returned by await _signInManager.CreateUserPrincipalAsync(user);
...
QUESTION
I stumbled upon OpenIddict and after going through a few example server code, I could not find what I was looking for. I was hoping to see an example of OpenIddict using auth code flow with PKCE, since that seems to be the recommended approach toward security now, but could not find one using both explicitly. My app is a ASP.NET Core WebAPI based app, with a React client. Any help or guidance would be appreciated.
...ANSWER
Answered 2019-Jun-21 at 14:29PKCE in OpenIddict works like in any other OIDC server: you just have to send a code_challenge
(and optionally a code_challenge_method
) when building your authorization request.
If you do that, OpenIddict will store it in the authorization code ticket and will compare it to the code_verifier
you send as part of the token request. If you don't send a code verifier, the token request will be automatically rejected.
In 3.0, we'll introduce an option allowing to reject authorization requests that don't use PKCE so that you can force your clients to use PKCE.
QUESTION
I am following the exact example from the OpenIddict example here: https://github.com/openiddict/openiddict-core. Everything works until I use the AddIdentity portion. I really need to use Identity. Commenting out the Identity portion will work, if it is uncommented then I get a 404 on the Get method in the test controller because it will not authorize. I am using .Net Core 2.x
Startup.cs:
...ANSWER
Answered 2019-Feb-25 at 04:49Adding the following lines of code at the end of the ConfigureServices method resolved the issue:
QUESTION
How can I set default scheme for Openiddict-core tables?
Unfortunately EF Core does't have (not that I know) a method that would accept only scheme and (EntityTypeBuilder.ToTable
) requires also table name, beside scheme.
ANSWER
Answered 2019-Feb-20 at 14:46There's nothing OpenIddict-specific to handle that, but it's easily achievable using the regular EF hooks. Here's an example:
QUESTION
I am trying to customize the OpenIddictApplication table and i am succeeded about that.
My problem is that when i try to generate token i got the following error "Cannot create a DbSet for 'OpenIddictApplication' because this type is not included in the model for the context".
Here is my service configuration:
...ANSWER
Answered 2019-Feb-20 at 14:33You simply forgot to configure the OpenIddict EF Core stores to use your custom entities:
QUESTION
I'm migrating from .NET Core 1.1 to 2.0, and now I have to update my Authentication too.
I'm using OAuth and OpenIddict to .NET Core 2.0
When I'm sending the request to my connect/token
I'm getting this:
OpenIddict.Server.OpenIddictServerHandler[0] The token response was successfully returned: {
"error": "unsupported_grant_type",
"error_description": "The specified 'grant_type' parameter is not supported."
}.
This is my request method:
...ANSWER
Answered 2018-May-11 at 12:53This happens because you do not configure the client credentials flow on you Startup.cs
.
See the example: https://github.com/openiddict/openiddict-samples/blob/dev/samples/ClientCredentialsFlow/AuthorizationServer/Startup.cs
Attention for line 52:
QUESTION
I have web api which uses jwt bearer authentication. The implementation (openiddict) which creates the jwt uses the the current url as issuer.
...ANSWER
Answered 2018-Apr-17 at 21:14I've looked into the code which generates my access token and found out that it only takes the current uri when no configuration value was set.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install openiddict-core
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page