DEV Community

Discussion on: Telegram OAuth Authorization for Your Site

Collapse
 
sandeep_web3 profile image
Sandeep Narahari

from where do we get the public key

Collapse
 
shaggyrec profile image
Alex Awesome

Read this post, please core.telegram.org/bots . It's enough to understand how to create telegram bots

Collapse
 
sandeep_web3 profile image
Sandeep Narahari

I didn't find anywhere named public key, could you please share exactly where your referring to

Thank you

Thread Thread
 
shaggyrec profile image
Alex Awesome

You are totally right. The article was translated and I don't remember where publicKey is from.

I've corrected the post

Collapse
 
mxlison profile image
mxlison • Edited

Create privKey using openssl genrsa 2048 > private.key, then use openssl rsa -in private.key -pubout to display pubKey, afterwards setup your pub key to bot, in @botfather using /setpublickey and send printed pubkey in format:

-----BEGIN PUBLIC KEY-----
YOUR PUBKEY
-----END PUBLIC KEY-----
Enter fullscreen mode Exit fullscreen mode

You can read this docs for better understanding Passport auth: core.telegram.org/passport