-
-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to authenticate #292
Comments
So to add a client I have this in startup but it throws an error
...... I searched a lot for this error and came across similar error here Again everything was working well before yesterdays update. May be I am missing something here to understand the new changes. Thanks in advance! |
That's the problem with generics: they are viral, so you must ensure everything is configured correctly. Replace |
I tried that too but still throws an error and when you say for my first comment above (and on chat-gitter), that at log level it is correct, i agree but by default .RequireClientIdentification() is enabled. So this statement is there or not there doesn't make a difference. May be this is a bug that by default is enabled even without .RequireClientIdentification()?? |
Not it's not. What's the exact exception you're getting? |
This is it from immediate window In my code everywhere int is present wherever required. var applications = context.Set<OpenIddictApplication< int >>(); in my dbcontext i have this
|
Read my first message, you missed something... |
the comment removed the < int > so i had to add space after and before lessthan/greater than sign.. sorry please see the above comment again. I know we need int everywhere as thats my tkey.. but it doesnt work. |
Alright, I see where the problem is. I'll fix it later today. |
ok cool. atleast i am sure now that it wasnt something i was doing wrong.. thank you. I will look forward to get an update, if possible let me know too what was it or may be I will check the git checkin comment. |
and one more thing back to the .RequireClientIdentification() problem. I still think its enabled by default coz when you run the password flow sample, and dont passin client_id for token/connect, and even when you do not have .RequireClientIdentification() then too it throws an error saying that client_id was not passed. However, I will test it again tomorrow after your fix regarding the type error. |
FYI, this issue was fixed as part of #294. Concerning client identification, I just tried the password flow and it worked fine. |
I am using your sample password flow. I upgraded to latest and I get this error in my log file.
Request starting HTTP/1.1 POST http://localhost:58795/connect/token application/x-www-form-urlencoded 86 (e5be5b71)
2016-12-13T02:10:25.7545959-08:00 0HL1380H89SH8 [INF] The token request validation process was skipped because the client_id parameter was missing or empty. (376dcc06)
2016-12-13T02:10:25.8501925-08:00 0HL1380H89SH8 [ERR] An unhandled exception has occurred while executing the request (cf926119)
System.InvalidOperationException: Unable to resolve service for type 'OpenIddict.Core.OpenIddictApplicationManager
1[OpenIddict.Models.OpenIddictApplication
1[System.Int32]]' while attempting to activate 'AuthorizationServer.AuthorizationController'.at Microsoft.Extensions.Internal.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)
Here is my startup changes:
services.AddOpenIddict()
// Register the Entity Framework stores.
.AddEntityFrameworkCoreStores<ApplicationDbContext, int>()
// Register the ASP.NET Core MVC binder used by OpenIddict.
// Note: if you don't call this method, you won't be able to
// bind OpenIdConnectRequest or OpenIdConnectResponse parameters.
.AddMvcBinders()
My Configure has
app.UseIdentity();
app.UseOAuthValidation();
app.UseOpenIddict();
app.UseMvcWithDefaultRoute();
Here is my Authorization Controller constructor
public AuthorizationController(
OpenIddictApplicationManager<OpenIddictApplication> applicationManager,
SignInManager signInManager,
ApplicationUserManager userManager)
{
_applicationManager = applicationManager;
_signInManager = signInManager;
_userManager = userManager;
}
It was all working fine before upgrade.. Do you know what could be wrong. I really appreciate your help!!
RP
The text was updated successfully, but these errors were encountered: