0
chanchai-mwp created
Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
- ABP Framework version: v3.0.5
- UI type: MVC
- Tiered (MVC) or Identity Server Seperated (Angular): yes
- Exception message and stack trace: error message: OpenIdConnectProtocolException: Message contains error: 'invalid_grant', error_description: 'error_description is null', error_uri: 'error_uri is null'.
- Steps to reproduce the issue: Login to website
Result:
Host (host db): success Tenant1 (host db): success Tenant2 (separate tenant db): fail
Could you please help?
Thanks, Chanchai
4 Answer(s)
-
0
Do you initialize seed data? try run the
.DbMigrator
project. -
0
I do.
-
0
I will check it out.
-
0
Hi,
This is a problem.
Try to add the following code to the
.identityserver
project:public class FormTenantResolveContributor: HttpTenantResolveContributorBase { public const string ContributorName = "Form"; public override string Name => "Form"; protected override string GetTenantIdOrNameFromHttpContextOrNull( ITenantResolveContext context, HttpContext httpContext) => httpContext.Request?.Form[context.GetAbpAspNetCoreMultiTenancyOptions().TenantKey]; }
Configure<AbpTenantResolveOptions>(options => { options.TenantResolvers.Add(new FormTenantResolveContributor()); });
Try to add the following code to the
.Web
project:.AddOpenIdConnect("oidc", options => { //....... options.Events = new OpenIdConnectEvents() { OnAuthorizationCodeReceived = receivedContext => { if (receivedContext.Request.Cookies.ContainsKey("__tenant")) { receivedContext.TokenEndpointRequest.SetParameter("__tenant", receivedContext.Request.Cookies["__tenant"]); } return Task.CompletedTask; ; } }; }