title: Tenants created in API manager are not able to login to the carbon console of the ID server
body: <p>I am using APIM 3.1.0 with IS-KM 5.10.0 as a key manager for the APIM. I created the tenants via the APIM carbon console. To create the XACML policies for newly created tenants I am trying to login to the carbon console of the IS using the credentials of the newly created tenant. But I am getting login failed error. At the same time, I can log in to the carbon console of the APIM using the credentials of the newly created tenant. Why newly created tenants via APIM carbon console are not able to login to the carbon console of the IS, any configurations I am missing?</p>
  <p>At the same time If I create the new tenant via the carbon console of the IS, tenants can log in to the carbon console of the IS but not to the carbon console of APIM. Is such a restriction a design intent? But ultimately I need the tenants to be created and require tenants to create the APIs, subscribe and should be able to create XACML policies</p>
  <p>I am getting below error in the IS logs when tenant created via APIM tries to login to the IS carbon console</p>
  <pre><code>    [2020-06-23 16:53:46,796] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantIdCache} - TENANT_ID_CACHE which is under TENANT_ID_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantIdEntry@4da389f0 for the key : org.wso2.carbon.user.core.tenant.TenantDomainKey@d03947ad successfully
  [2020-06-23 16:53:46,888] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,889] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,889] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,889] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,890] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantIdCache} - TENANT_ID_CACHE which is under TENANT_ID_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantIdEntry@4da389f0 for the key : org.wso2.carbon.user.core.tenant.TenantDomainKey@d03947ad successfully
  [2020-06-23 16:53:46,890] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantCache} - TENANT_CACHE which is under TENANT_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantCacheEntry@3080dc47 for the key : org.wso2.carbon.user.core.tenant.TenantIdKey@9 successfully
  [2020-06-23 16:53:46,890] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,890] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,890] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantDomainCache} - TENANT_DOMAIN_CACHE which is under TENANT_DOMAIN_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantDomainEntry@38942044 for the key : org.wso2.carbon.user.core.tenant.TenantIdKey@9 successfully
  [2020-06-23 16:53:46,891] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantManager} - Tenant domain from cache: {api.com}
  [2020-06-23 16:53:46,891] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.UserIdResolverCache} - Cache: user_id_from_user_name_cache which is under USER_ID_RESOLVER_CACHE_MANAGER, found the entry: 6160fac5-11d5-4061-a677-f8eb416ecf52 for the key: vinayak successfully.
  [2020-06-23 16:53:46,891] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantDomainCache} - TENANT_DOMAIN_CACHE which is under TENANT_DOMAIN_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantDomainEntry@38942044 for the key : org.wso2.carbon.user.core.tenant.TenantIdKey@9 successfully
  [2020-06-23 16:53:46,891] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantManager} - Tenant domain from cache: {api.com}
  [2020-06-23 16:53:46,891] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantDomainCache} - TENANT_DOMAIN_CACHE which is under TENANT_DOMAIN_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantDomainEntry@38942044 for the key : org.wso2.carbon.user.core.tenant.TenantIdKey@9 successfully
  [2020-06-23 16:53:46,891] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantManager} - Tenant domain from cache: {api.com}
  [2020-06-23 16:53:46,892] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantIdCache} - TENANT_ID_CACHE which is under TENANT_ID_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantIdEntry@4da389f0 for the key : org.wso2.carbon.user.core.tenant.TenantDomainKey@d03947ad successfully
  [2020-06-23 16:53:46,892] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantIdCache} - TENANT_ID_CACHE which is under TENANT_ID_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantIdEntry@4da389f0 for the key : org.wso2.carbon.user.core.tenant.TenantDomainKey@d03947ad successfully
  [2020-06-23 16:53:46,892] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantDomainCache} - TENANT_DOMAIN_CACHE which is under TENANT_DOMAIN_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantDomainEntry@38942044 for the key : org.wso2.carbon.user.core.tenant.TenantIdKey@9 successfully
  [2020-06-23 16:53:46,892] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantManager} - Tenant domain from cache: {api.com}
  [2020-06-23 16:53:46,893] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.tenant.TenantIdCache} - TENANT_ID_CACHE which is under TENANT_ID_CACHE_MANAGER, found the entry : org.wso2.carbon.user.core.tenant.TenantIdEntry@4da389f0 for the key : org.wso2.carbon.user.core.tenant.TenantDomainKey@d03947ad successfully
  [2020-06-23 16:53:46,893] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,893] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,893] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,893] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,894] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] DEBUG {org.wso2.carbon.user.core.common.RealmCache} - created authorization cache : org.wso2.carbon.caching.impl.CacheImpl@922bea56
  [2020-06-23 16:53:46,897] [ee58cfbc-ccc7-497d-b51e-0f3eb941fa8a] ERROR {org.wso2.carbon.core.services.authentication.AuthenticationAdmin} - System error while Authenticating/Authorizing User : Error when handling event : PRE_AUTHENTICATION
  </code></pre>
  <p>I have following datasources configured in the APIM. why there are two registry data bases? (one is wso2_shareddb, another is wso2_carbondb)</p>
  <p><a href="https://i.stack.imgur.com/n3pdl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/n3pdl.png" alt="enter image description here" /></a></p>