Hi and excuse me for large text.
I have a REST app with a module for communication with Keycloak. I use Keycloak "admin" user in realm to manage users. Also, perform REST calls to obtain an access token for user using username and password. So my backend app is a kind of proxy.
Now I need to implement integration with another IDP (BankID), and both (Keycloak and BankId) should be in use.
A user on UI redirects to the BankID login page after successful authentication is redirected to UI with code, and UI makes the call to the backend, where backend using received code from UI request sensitive data from BankID IDP. In response, I receive an email and the rest of the information. So, this user is trusted, and I should retrieve Keycloak access_token for this user using received mail from another IDP (because this user was registered in Keycloak previously 100%).
And here is a problem - I can't retrieve token for this user from Keycloak because I have only email and no password. I have no idea how can I rich this without a user password that is stored on the Keycloak side.
I tried Token Exchange, Impersonation, Direct Naked Impersonation, but nothing help (hoppy I did something wrongly and it is possible to do)