MadelineProtoDocs/old_docs/API_docs_v89/constructors/account.password.md

50 lines
2.7 KiB
Markdown
Raw Normal View History

2019-06-23 13:07:51 +02:00
---
title: account.password
2019-12-27 17:48:04 +01:00
description: Configuration for two-factor authorization
2019-06-23 13:07:51 +02:00
image: https://docs.madelineproto.xyz/favicons/android-chrome-256x256.png
2019-12-27 18:46:25 +01:00
redirect_from: /API_docs/constructors/account_password.html
2019-06-23 13:07:51 +02:00
---
# Constructor: account.password
[Back to constructors index](index.md)
2019-12-27 17:48:04 +01:00
Configuration for two-factor authorization
2019-06-23 13:07:51 +02:00
### Attributes:
| Name | Type | Required | Description |
|----------|---------------|----------|-------------|
2019-12-27 17:48:04 +01:00
|has\_recovery|[Bool](../types/Bool.md) | Optional|Whether the user has a recovery method configured|
|has\_secure\_values|[Bool](../types/Bool.md) | Optional|Whether telegram [passport](https://core.telegram.org/passport) is enabled|
|has\_password|[Bool](../types/Bool.md) | Optional|Whether the user has a password|
|current\_algo|[PasswordKdfAlgo](../types/PasswordKdfAlgo.md) | Optional|The [KDF algorithm for SRP two-factor authentication](https://core.telegram.org/api/srp) of the current password|
|srp\_B|[bytes](../types/bytes.md) | Optional|Srp B param for [SRP authorization](https://core.telegram.org/api/srp)|
|srp\_id|[long](../types/long.md) | Optional|Srp ID param for [SRP authorization](https://core.telegram.org/api/srp)|
|hint|[string](../types/string.md) | Optional|Text hint for the password|
|email\_unconfirmed\_pattern|[string](../types/string.md) | Optional|A [password recovery email](https://core.telegram.org/api/srp#email-verification) with the specified [pattern](https://core.telegram.org/api/pattern) is still awaiting verification|
|new\_algo|[PasswordKdfAlgo](../types/PasswordKdfAlgo.md) | Yes|The [KDF algorithm for SRP two-factor authentication](https://core.telegram.org/api/srp) to use when creating new passwords|
|new\_secure\_algo|[SecurePasswordKdfAlgo](../types/SecurePasswordKdfAlgo.md) | Yes|The KDF algorithm for telegram [passport](https://core.telegram.org/passport)|
|secure\_random|[bytes](../types/bytes.md) | Yes|Secure random string|
2019-06-23 13:07:51 +02:00
2019-12-27 18:25:37 +01:00
### Type: [account.Password](../types/account.Password.md)
2019-06-23 13:07:51 +02:00
### Example:
```php
2019-12-27 18:25:37 +01:00
$account.password = ['_' => 'account.password', 'has_recovery' => Bool, 'has_secure_values' => Bool, 'has_password' => Bool, 'current_algo' => PasswordKdfAlgo, 'srp_B' => 'bytes', 'srp_id' => long, 'hint' => 'string', 'email_unconfirmed_pattern' => 'string', 'new_algo' => PasswordKdfAlgo, 'new_secure_algo' => SecurePasswordKdfAlgo, 'secure_random' => 'bytes'];
2019-06-23 13:07:51 +02:00
```
Or, if you're into Lua:
```lua
2019-12-27 18:25:37 +01:00
account.password={_='account.password', has_recovery=Bool, has_secure_values=Bool, has_password=Bool, current_algo=PasswordKdfAlgo, srp_B='bytes', srp_id=long, hint='string', email_unconfirmed_pattern='string', new_algo=PasswordKdfAlgo, new_secure_algo=SecurePasswordKdfAlgo, secure_random='bytes'}
2019-06-23 13:07:51 +02:00
```