Hi
Our web mvc project running and we can login.
But we can not authenticate from api client, we got invalid_grant , invalid_user_or_password error.
But username and password are correct, client id correct, address correct.
Do you have any idea ?
Muhittin
24 Answer(s)
-
0
Hi @muhittincelik,
What is your ABP and AspNet Zero version ? I remember a similar problem in one of the v5.x versions.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
do you have tenantId. if yes do not forget setting proper cookie Abp.TenantId = YourTenantId
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
We have default tenant.
Our version is 5.6.2.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Is this a bug ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @muhittincelik,
Have you disabled Multi Tenancy in your project ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
MultiTenancyEnabled = true
And i have 2 warning in dependencies; I rebuild several times.
1- *.Core.Shared - System.ComponentModel.DataAnnotations (!) 2- *.Web.Mvc - npm.bootstrap4-datetimepicker.moment-timezone (not installed)
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I think I have found the problem;
Assuming you have below settings in appsettings.json file;
"ApiName": "default-api", "ApiSecret": "secret"You need to change GetApiResources method of IdentityServerConfig like below;
public static IEnumerable<ApiResource> GetApiResources() { return new List<ApiResource> { new ApiResource("default-api", "Default (all) API") { Description = "AllFunctionalityYouHaveInTheApplication", ApiSecrets= {new Secret("secret") } } }; }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Nothing changed. :(
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
You are probably passing wrong secret to server. Although secret must be hashed.
Try hashing the secret.
public static IEnumerable<ApiResource> GetApiResources() { return new List<ApiResource> { new ApiResource("default-api", "Default (all) API") { Description = "AllFunctionalityYouHaveInTheApplication", ApiSecrets= {new Secret("secret").Sha256() } } }; }Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
@muhittincelik is it possible to share your project via email to [email protected] ? If so, we can try to help you in a short time.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Sha256() için böyle bir extension yok dedi. Siz deneyebildiniz mi ?. Webex açabilirim bir bakabilirsiniz.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
It's under IdentityServer4.Models namespace that you are probably missing. You can get it from nuget.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
There is no package with that name on Nuget .
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I will try;
ApiSecrets= {new Secret("secret".Sha256())}
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
:( same error.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
@muhittincelik can you share server logs?
Its very hard to troubleshoot identityserver problems without logs.
You can implement how to via how to log identityserver if you haven't already.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I think, i need webex or teamviwer. I can not configure Loging.
When i install nuget package there is exclamation on it.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Which version is stable for AspNetZero Core & JQuery?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Can you send me a running example.
Thanks
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
@muhittincelik is it possible to share your project via email to [email protected] ?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
You can use your 5.6.2 Core & JQuery package. I didnt add anything yet.
I am learning your framework and i will integrate our desktop software with your web application via api.
Muhittin
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
I got the following output now; I think i have no authorization for getuserlist. But I have all auths.
token deteils... ... ..
Unauthorized
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
@muhittincelik yes, raw v5.6.2 project has a problem like you said but according to my tests, it is fixed via https://github.com/aspnetzero/aspnet-zero-core/commit/159085163e4fb12dd77c964d5b706969662fac7c
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Thanks İsmail.
It is OK.
Muhittin
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)