QR code login from a phone to a PC

Hello Team,
I need one help. Actually my use case is create a QR code. User will scan the QR code from his phone and it will be login to the PC/Desktop.
A fine example of this is login to WhatsApp web.

If anyone has done this before then please suggest me a way to achieve this goal.

Thanks,
Vasu

1 Like

The bankid4keycloak project does something similar to this. Perhaps you can take some inspiration from there.

The project act as a “IDP” that authenticate towards the Swedish Bank ID services by fetching a token from the “Bank ID” server which is then shown as a QR code. “Keycloak” then periodically poll the status of from the “Bank ID” server.
The user scan using the Bank ID app and authenticate using it after which the “Bank ID” server tells “Keycloak” that the authentication was successful and we can complete the login.

It sound like your use-case might be similar, however depending on your use case you might want to implement this as an authenticator instead.

Pontus Ullgren

Take a look at the DeviceAuthorizationGrant type . See [1]

[1] keycloak-community/oauth2-device-authorization-grant.md at main · keycloak/keycloak-community · GitHub