Auth Widget
Implementation of Telegram site authorization checking mechanism for more information https://core.telegram.org/widgets/login#checking-authorization
Source: https://gist.github.com/JrooTJunior/887791de7273c9df5277d2b1ecadc839
- aiogram.utils.auth_widget.generate_hash(data: dict, token: str) str [source]
Generate secret hash
- Parameters
data –
token –
- Returns
- aiogram.utils.auth_widget.check_token(data: dict, token: str) bool [source]
Validate auth token
- Parameters
data –
token –
- Returns
- aiogram.utils.auth_widget.check_signature(token: str, hash: str, **kwargs) bool [source]
Generate hexadecimal representation of the HMAC-SHA-256 signature of the data-check-string with the SHA256 hash of the bot’s token used as a secret key
- Parameters
token –
hash –
kwargs – all params received on auth
- Returns