var client = new RestClient("https://localhost:44322/connect/token"); client.Timeout = -1; var request = new RestRequest(Method.POST); request.AddHeader("Content-Type", "application/x-www-form-urlencoded"); request.AddParameter("client_id", "DemoApplicationClient"); request.AddParameter("client_secret", "1q2w3e*"); request.AddParameter("grant_type", "password"); request.AddParameter("username", "admin"); request.AddParameter("password", "1q2w3E*"); request.AddParameter("scope", "ProductService"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);
It works as expected on password flow.
I could not test it on refresh_token flow. I will open another ticket for that issue.
Thank for your support.
Hi,
I think the document is not about adding new claims to the token. It is about switching the destination of an already added claim. It helps to decide where the claim exists (idtoken or accesstoken).
The claims property of the context is a readonly array and can not be altered. Using this class, I can not add a new claim to the context but I can alter it is destination.
I need to add new claims to the context, not to alter their locations.
Thanks
Hi Malik,
After a bit of work, dynamic proxies works as expected. I somehow managed to run microservices with dynamic proxies.
I will be glad if any solution for afterLeptonXInitialization error is supplied.
Thanks in advance. Regars.
I have figured out the proxy problem. I added reference to product api project and inserted following code to the gatewaymodule.cs
app.MapWhen(
ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/api-definition") ||
ctx.Request.Path.ToString().TrimEnd('/').Equals(""),
app2 =>
{
app2.UseRouting();
app2.UseConfiguredEndpoints();
}
);
app.MapWhen(
ctx => ctx.Request.Path.ToString().StartsWith("/metrics"),
app2 =>
{
app2.UseRouting();
app2.UseHttpMetrics();
app2.UseConfiguredEndpoints(endpoints =>
{
endpoints.MapMetrics();
});
}
);
It fixed the issue.
Issue stated at step 8 can be answered. I still get the "Could not find 'afterLeptonXInitialization'" error on first run.
I have updated all of the scope names in the database. Removed the redis image from docker and re-installed it.
I have tested the updated scope names in a small test app, it works properly. No more scope lenght error occurs. This will give me some time, I hope you figure out a proper fix about the error till then.
I have tried to rename the scope names in database by getting rid of the "Service" postfix to minimize the total scopes length but admin ui somehow kept asking for the original scope names during the authentication flow. I could not figure out how to shorten the names properly. I can not figure out where to change in the application code to override original scope names.
Below is the related request body - log;
{"ClientId":"CoMed_Blazor","ClientName":"CoMed_Blazor","RedirectUri":"https://???.???.com.tr/authentication/login-callback","AllowedRedirectUris":["http://???/#/login-callback","https://????/authentication/login-callback","https://???/Home/Privacy","https://???/#/login-callback"],"SubjectId":"anonymous","ResponseType":"code","ResponseMode":"query","GrantType":"authorization_code","RequestedScopes":"","State":"a7b59c9e5c9a492bb31807792b623bcc","UiLocales":null,"Nonce":null,"AuthenticationContextReferenceClasses":null,"DisplayMode":null,"PromptMode":"","MaxAge":null,"LoginHint":null,"SessionId":null,"Raw":{"client_id":"CoMed_Blazor","redirect_uri":"https://???/authentication/login-callback","response_type":"code","scope":"openid profile role email phone AuthServer IdentityService AdministrationService SaasService TimelineService AppointmentService ResourceService EResultService PrescriptionService ProfileService ConnectorService VideoService IOService PaymentService MessageService SurveyService ContentService AgentService","state":"a7b59c9e5c9a492bb31807792b623bcc","code_challenge":"uyU0F1tAHimKrLwGDJ8OgUB47A0zx6DXV3zVPbF5XnM","code_challenge_method":"S256","response_mode":"query"},"$type":"AuthorizeRequestValidationLog"}
Yes