I have a multitenant application where a user can belong to multiple tenants. I'm using Identity-Server 4 for the authentication.
I have two applications Angular and API. When a user is not authenticated, it's being redirected to the Identity-Server and proceeds authentication. Once the ID4 ensures that the client credentials are correct a new access_token is generated and returned to the Angular side. then the Angular checks the tenant ID and if it is not present to the access_token it redirects to the tenant page where a user must select a tenant. Once the tenant ID is selected initLoginFlow is called and the tenant ID is sent to the identity-server side. Identity-Server looks for the tenant ID and if it's found then it issues another access_token that contains the tenant ID.
I have couple of questions:
- Is it possible to call ProfileService on the Identity-Server side from Angular to update the identity_token?
- Is the implementation flow correct?