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.
-
0
do you have tenantId. if yes do not forget setting proper cookie Abp.TenantId = YourTenantId
-
0
We have default tenant.
Our version is 5.6.2.
-
0
Is this a bug ?
-
0
Hi @muhittincelik,
Have you disabled Multi Tenancy in your project ?
-
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)
-
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") } } }; }
-
0
Nothing changed. :(
-
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() } } }; }
-
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.
-
0
Sha256() için böyle bir extension yok dedi. Siz deneyebildiniz mi ?. Webex açabilirim bir bakabilirsiniz.
-
0
It's under IdentityServer4.Models namespace that you are probably missing. You can get it from nuget.
-
0
There is no package with that name on Nuget .
-
0
I will try;
ApiSecrets= {new Secret("secret".Sha256())}
-
0
:( same error.
-
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.
-
0
I think, i need webex or teamviwer. I can not configure Loging.
When i install nuget package there is exclamation on it.
-
0
Which version is stable for AspNetZero Core & JQuery?
-
0
Can you send me a running example.
Thanks
-
0
@muhittincelik is it possible to share your project via email to [email protected] ?
-
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
-
0
I got the following output now; I think i have no authorization for getuserlist. But I have all auths.
token deteils... ... ..
Unauthorized
-
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
-
0
Thanks İsmail.
It is OK.
Muhittin