
If they match, auhtorization was successful and you can return the telegram user details object from the authorize callback. You would have to replace the nextauth credentials login fields with the telegram login widget through a custom nextauth sign-in page, then in the authorize callback of the credentials provider, do the comparison of the returned telegram hash and the sha256 of the bot's secret key, see checking authorization in their login widget page you linked. The user clicks "login" and enters their telegram number, the bot sends them a confirmation code which they then enter in the login widget. As there are no username/password provided here it would be a bit trickier to get this working.įrom their docs you've linked, it looks like you setup a Telegram bot for your app / company. However, you could use the credentials provider to implement a custom telegram provider.


The Telegram auth isn't a classic OAuth implementation.
