when I try logging into publisher (https://localhost:9443/publisher), I get an -
Cannot find an application associated with the given consumer key : undefined
Have no problem logging into devportal.
Can anyone suggest what could the reason be.
Thanks
@kharsha64
Can you try with a private browser and check?
@Krishanx92
Hi,
I tried that as well but am getting the same error for the publisher.
Thanks
Hi @kharsha64 ,
Have you deleted the SP application created using management console. Ex: admin_apim_publisher default SP app.
The error "Cannot find an application associated with the given consumer key : undefined" might occur due to above issue and also for trying out an old cached consumer key. Therefore, also try to clean the cache in the browser before trying out.
Hi,
No, I haven't deleted any SP. Am using the default SPs that come with the application.
Have tried clearing the browser cache and also tried it with different browsers.
But in vain. Same error.
Thanks
Hi login to the carbon console and go to service providers and click edit in "admin_publisher" and expand Inbound Authentication Configuration -> OAuth/OpenID Connect Configuration.
Then check the client ID of the SP OAuth App against the CLIENT_ID cookie in the browser.
If the both are same then the above issue shouldn't occur, if they are different try removing cookies in the browser and login to the publisher again.
Hi,
I noticed that the CLIENT_ID cookie is coming as undefined.
Cleared the cookie and tried again.
But the CLIENT_ID comes back as undefined.
Hi @CrowleyRajapakse
I removed the publisher service provider and after that I imported service provider.
Now the consumer key in Carbon differs from the one existing in the cookie. So, I removed the cookie and tried to load publisher page but it loads
Cannot find an application associated with the given consumer key : ***old consumer key***
And that's because in the cookie the old consumer key appears.
Please help, me to fix this problem.
I've also ran into a similiar problem. For me this problem overlapped with #7254. This took quite some time to figure out and fix.
The errors I encountered are as follows:
In /devportal/
login page I've seen:
invalid_client: Cannot find an application associated with the given consumer key: ...
In api-manager
docker container I've seen:
ERROR - DefaultRequestCoordinator Context does not exist. Probably due to invalidated cache.
ERROR - WebAppManager org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from undefined (/publisher/services/login/login_callback.jag#53)
The reason seems to be that under Carbon => Service Providers => admin_admin_store => Edit => Inbound Authentication Configuration => OAuth/OpenID Connect Configuration
the attributes client_secret
and/or client_id
changed.
The solution was to do the following:
SELECT * FROM public.am_system_apps;
and confirm that client_secret
and/or client_id
is correct. If not, set these values to ones seen in the Carbon admin_admin_store
service provider page.SELECT * FROM public.idn_oauth_consumer_apps;
and confirm that client_secret
and/or client_id
is correct. If not, set these values to ones seen in the Carbon admin_admin_store
service provider page.VACUUM (FULL) wso2;
Suffice it to say - this is an insane amount of work to do just because you clicked Regenerate secret
in an admin panel... And what's worse is that supposedly I had to know not to click that button. And even worse - this seems to be undocumented (or maybe I didn't find this in docs).
Most helpful comment
I've also ran into a similiar problem. For me this problem overlapped with #7254. This took quite some time to figure out and fix.
The errors I encountered are as follows:
In
/devportal/
login page I've seen:invalid_client: Cannot find an application associated with the given consumer key: ...
In
api-manager
docker container I've seen:ERROR - DefaultRequestCoordinator Context does not exist. Probably due to invalidated cache.
ERROR - WebAppManager org.mozilla.javascript.EcmaError: TypeError: Cannot read property "length" from undefined (/publisher/services/login/login_callback.jag#53)
The reason seems to be that under
Carbon => Service Providers => admin_admin_store => Edit => Inbound Authentication Configuration => OAuth/OpenID Connect Configuration
the attributesclient_secret
and/orclient_id
changed.The solution was to do the following:
SELECT * FROM public.am_system_apps;
and confirm thatclient_secret
and/orclient_id
is correct. If not, set these values to ones seen in the Carbonadmin_admin_store
service provider page.SELECT * FROM public.idn_oauth_consumer_apps;
and confirm thatclient_secret
and/orclient_id
is correct. If not, set these values to ones seen in the Carbonadmin_admin_store
service provider page.VACUUM (FULL) wso2;
Suffice it to say - this is an insane amount of work to do just because you clicked
Regenerate secret
in an admin panel... And what's worse is that supposedly I had to know not to click that button. And even worse - this seems to be undocumented (or maybe I didn't find this in docs).