I am requesting a token, but for this client, it does not work as I am getting bellow error:
The client exists as all other applications are working. The only issues is when I am accessing token like bellow: https://domain/auth/realms/MyRealm/protocol/openid-connect/token
You are editing client portal, but your request uses portal1 client. Check also Keycloak logs - returned error description may not be usefull, but logs very likely contain more technical details, e.g. backtrace of that internal error/exception.
Generally, it should works. But you have some setup, which is causing a trouble.
invalid_client_credentials indicates a problem with your client credentials (not with user credentials). I bet you have some custom/customized flow defined, which is causing a problem.
Start new Keycloak from the scratch and create new client only - your curl test case should be working without any problem. That will prove that your setup (but not a client setup, it can be flow, realm, … setup) is causing a problem.
@jangaraj, yes, this works. Other clients are ok. I know that some setting is causing this. I want to figure out why. Otherwise, I would need to create a whole client again (it has a lot of ROLS).