We are currently in the process of implementing multi tenancy but most likely have an odd domain setup.
Our customers will be able to go to exampleapp.com or tenant.exampleapp.com. If they go to the apex domain they will be asked to find their tenant. When the user is on the correct tenant e.g. tenant1.exampleapp.com they will have all the applications available (before logging in).
The user then clicks on an application and gets redirected to the application with the tenant in the query string e.g. app1.exampleapp.com?__tenant=tenantname. I have made a change where if the user is not already authenticated they will be redirected to auth server (exampleapp.com) with the tenant in the domain (tenant.exampleapp.com).
I have resolved the invalid issuer issue but now facing the invalid_grant error and not sure how to resolve this.
The main goal is to all the customer to have a vanity url to the landing page so it can be branded etc but the main applications (which there are 3 for our customers) are all on specific subdomains (app1, app2, app3.exampleapp.com). I have tried simply redirecting the user to the auth server with __tenant query string but the tenant gets lost in all the redirects.
10 Answer(s)
-
0
hi
now facing the invalid_grant error and not sure how to resolve this.
Can you share full debug/error logs?
https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems
Thanks.
-
0
Hi,
Just sent an email with the logs and module classes.
Thanks
-
0
hi
Message contains error: 'invalid_grant', error_description: 'The issuer associated to the specified token is not valid.', error_uri: 'https://documentation.openiddict.com/errors/ID2088', status code '400'.
The
issuer
in your access token has a problem.Can you share an access token with liming.ma@volosoft.com
Thanks.
-
0
The issuer would have been the tenant version of the login page where as the app is using the authority.
How do I get an access token to share with you?
-
0
hi
Add a middleware to your
https://localhost:44374
, then write theAuthentication
header to the logs.GET /https://localhost:44374 HTTP/1.1 Host: https://localhost:44374 Authorization: Bearer eyJhbGciOi// your access token.
also enable debug/verb logs
-
0
hi
IDX10205: Issuer validation failed. Issuer: 'https://localhost:44372/'. Did not match: validationParameters.ValidIssuer: 'null' or validationParameters.ValidIssuers: '{0}.localhost'.
Please try to add
https://localhost:44372/
toValidIssuers
list.And your
wildcard domain format: *.localhost
needs the port. -
0
HI,
Valid issuers is not the problem I am facing.
-
0
Is the
Message contains error: 'invalid_grant', error_description: 'The issuer associated to the specified token is not valid.'
error solved? -
0
Applied the change and fixed the if statement and still get the invalid_grant error.
Instead of us redirecting the user from the auth-server to tenant.auth-server then to the app. Is there a way for the app to persist the __tenant query string when the user gets redirected to /connect/authorize then to the /account/login?
-
0
and still get the invalid_grant error.
Please share the new
host - identitymodel.txt
again.The issuer should end with
/
https://localhost:44372/