> For the complete documentation index, see [llms.txt](https://painor.gitbook.io/gramjs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://painor.gitbook.io/gramjs/working-with-2fa-login/account.getpassword.md).

# account.getPassword

Obtain configuration for two-factor authorization with password

## Example

{% tabs %}
{% tab title="Javascript" %}

```javascript
const {Api, TelegramClient} = require('telegram');
const {StringSession} = require('telegram/sessions');

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result = await client.invoke(new Api.account.getPassword({
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}

{% tab title="TypeScript" %}

```typescript
import {Api, TelegramClient} from 'telegram';
import {StringSession} from 'telegram/sessions';

const session = new StringSession('');
const client = new TelegramClient(session, apiId, apiHash, {});

(async function run() {
    const result: Api.account.Password = await client.invoke(new Api.account.getPassword({
        }));
    console.log(result); // prints the result
})();
```

{% endtab %}
{% endtabs %}

## TL schema

```
account.password#ad2641f8 flags:# has_recovery:flags.0?true has_secure_values:flags.1?true has_password:flags.2?true current_algo:flags.2?PasswordKdfAlgo srp_B:flags.2?bytes srp_id:flags.2?long hint:flags.3?string email_unconfirmed_pattern:flags.4?string new_algo:PasswordKdfAlgo new_secure_algo:SecurePasswordKdfAlgo secure_random:bytes = account.Password;
---functions---
account.getPassword#548a30f5 = account.Password;
```

## Parameters

| Name | Type | Description |
| :--: | ---- | ----------- |

## Result

[account.Password](https://core.telegram.org/type/account.Password)

## Possible errors

| Code | Type | Description |
| :--: | ---- | ----------- |

## Can bots use this methd ?

### yes

## Related pages
