I'm having an issue while trying to run both the consoleapiclient and the public site.
The clientapi app runs and I get a token, but the subsequent call to
await GetUsersListAsync(accessToken);
returns an "unauthorized"
The appsettings.json file on the server has this definition for the client:
{
"ClientId": "client",
"AllowedGrantTypes": [
"password"
],
"ClientSecrets": [
{
"Value": "def2edf7-5d42-4edc-a84a-30136c340e13"
}
],
"AllowedScopes": [
"default-api",
"openid"
]
},
Any help on what I might be doing wrong?
11 Answer(s)
-
0
Did you change anything in ConsoleApiClient? For example username or password?
-
1
https://support.aspnetzero.com/QA/Questions/5611#answer-453ccd2d-5dd4-f7e1-ce72-39e91e2251e0
-
0
-
0
enable Identity server in appsettings.json
-
0
-
0
@lhightower have you fixed the problem ? The app might still be reading from the appsettings.json in the bin folder.
-
0
or if you changed the environment variable, it can read from appsettings.production.json as well.
-
0
Actually this issue existed also in 5.6.2 , i have the same problem. in fact hybrid authentication mode also does not work...
-
0
@scharada did you ever figure out what the issue was? This is a showstopper for me b/c this is the only reason I purchased AspNetZero.
-
0
Hi @lhightower, this problem should be fixed in v6.0. If you use older version than v6.0, then you can apply THIS change to fix problem.
-
0
actually you have a guide in your current code-base (if you're using core version). The Xamarin application is connecting to the backbone and consuming application services. So take look at this code which logins with a user and then makes all the actions which needs authentication.
And there's AbpApiClient class which sends POST/GET/PUT/DELETE actions to the AspNet Zero application services. Take your time and see those classes. It works just as you want.