# Login Commands

### Commands:

1. [Login](#login-command)
2. [Logout](#logout-command)
3. [Whoami](#whoami-command)

Keeper supports multiple login methodologies, these include&#x20;

### Authentication Workflow (High-Level)

* **Primary Authentication**
  * Regular account (username + master password)
  * Cloud SSO (SAML, OIDC)
  * On-Premises SSO
  * Managed Company (MSP) login
* **Secondary Authentication (2FA)**
  * TOTP (Google/Microsoft Authenticator)
  * SMS one-time code
  * DUO (push, SMS, voice)
  * RSA SecurID
  * WebAuthn/U2F (security keys, biometrics)
* **Device Approval**
  * Email link
  * 2FA challenge
  * Keeper Push notification

### SDK Authentication Flow

1. **Initialize SDK client/session context**
2. **Select login method** (master password, SSO, MSP)
3. **Handle challenges issued by Keeper**
   * 2FA challenge
   * Device approval
   * Security key prompt
4. **Establish secure session**
   * Receive encrypted session token
   * Unlock vault and enterprise APIs

### Login Command

Authenticate to start a session.

<details>

<summary>DotNet CLI</summary>

**Command:** `login`

**Flag:**&#x20;

* `--password` master password
* `--resume` resume last login
* `--sso` login using sso provider
* `--alt` login using sso master password
* `--help` Display this help screen.
* `--version` Display version information.
* `email (pos. 0)` Required. account email

**Example:**

```bash
Not logged in> login user@example.com --password 1234567890qwertyuiop
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `IAuth.Login`

```csharp
 public async Task Login(string username, params string[] passwords)
```

**Example:**

```csharp
 await auth.Login(email, passwds.ToArray());
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Connect-Keeper`  \
**Alias :** `kc`&#x20;

**Flag:**&#x20;

* `-Username` &#x20;
* `-Password`  &#x20;
* `-NewLogin`  &#x20;
* `-Server` &#x20;
* `-Config` &#x20;
* `-SsoPassword` &#x20;
* `-SsoProvider`  <br>

**Example:**

<pre class="language-powershell"><code class="lang-powershell"><strong>PS > Connect-Keeper -Username "your@email.com" -Password (Read-Host -AsSecureString -Prompt "yourpassword")
</strong></code></pre>

</details>

<details>

<summary>Python CLI</summary>

**Command:** `login`&#x20;

**Flag:**&#x20;

* `-h, --help` : show this help message and exit
* `--sso-password`  : force master password for SSO accounts
* `--resume-session`  : resumes current login session
* `-p, --pass`  : PASSWORD master password<br>

**Example :**

```bash
My Vault > login user@example.com --pass qwertyuiop1234567890
```

</details>

<details>

<summary>Python SDK</summary>

Function: [refer here](https://docs.keeper.io/en/keeperpam/commander-cli/commander-installation-setup/developer-mode/commander-sdk-for-python#create-an-application)

</details>

### Logout Command

Securely log out from the CLI.

<details>

<summary>DotNet CLI</summary>

**Command:** `logout`

**Flag:**&#x20;

* `--resume` : resume last login
* `--help` : Display this help screen.
* `--version` : Display version information.

**Example:**

```bash
My Vault > logout
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `IAuthentication.Logout`

```csharp
public virtual async Task Logout()
```

**Example:**

```csharp
await DoLogout();
```

</details>

<details>

<summary>PowerCommander</summary>

**Command:** `Disconnect-Keeper` &#x20;

**Aliases:** `kq`

**Flag:**&#x20;

* `-Resume`&#x20;

**Example:**

```powershell
PS > Disconnect-Keeper 

PS > kq
```

</details>

<details>

<summary>Python CLI</summary>

**Command:** `logout`&#x20;

**Example:**

```bash
My Vault > logout 
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** `close`&#x20;

**Example:**

```
vault.close()
keeper_auth.close()
```

</details>

### Whoami Command

Displays information about the current authenticated user, including username and email.

<details>

<summary>DotNet CLI</summary>

**Command:** `whoami`&#x20;

**Example:**

```bash
My Vault > whoami
            User:  user@example.com
          Server:  keepersecurity.com      
     Data Center:  US                      
           Admin:  Yes                     
    Account Type:  2                       
    Renewal Date:  May 28, 2027            
Storage Capacity:  1024GB                  
   Storage Usage:  0GB                     
 Storage Expires:  May 28, 2027            
    License Type:  Keeper for Business     
 License Expires:  May 28, 2027            
       Base Plan:  Enterprise              
     BreachWatch:  Yes     
```

</details>

<details>

<summary>DotNet SDK</summary>

**Function:** `Authentication.IAuthContext`&#x20;

**Example:**

```csharp
private Task WhoamiCommand(string _)
```

</details>

<details>

<summary>Power Commander</summary>

**Command:** `Get-KeeperInformation`&#x20;

**Alias:** `kwhoami`&#x20;

**Example:**

```powershell
PS > Get-KeeperInformation
User            : user@example.com
Server          : keepersecurity.com
Admin           : True
AccountType     : Enterprise
RenewalDate     : May 28, 2027
StorageCapacity : 1024
StorageUsage    : 0
StorageExpires  : May 28, 2027

LicenseType     : Enterprise
EnterpriseName  : Example
BasePlan        : Unknown
Expires         : 5/28/2027
StorageCapacity : 1TB
TotalUsers      : 20
ActiveUsers     : 6
InvitedUsers    : 0
```

</details>

<details>

<summary>Python CLI</summary>

**Command:** `whoami`

**Flag** :&#x20;

* `-h, --help` : show this help message and exit
* `-v, --verbose` : verbose output

**Example:**

```bash
My Vault> whoami -v
              User  user@example.com
            Server  keepersecurity.com
       Data Center  US
             Admin  True
      Account Type  Enterprise
      Renewal Date  May 28, 2027
       BreachWatch  True
Reporting & Alerts  True
           Records  11
    Shared Folders  11
             Teams  11
```

</details>

<details>

<summary>Python SDK</summary>

**Function:** Not Supported

</details>

### Get and Set Keeper Password Visible command

Displays information about the current authenticated user, including username and email.

<details>

<summary>DotNet CLI</summary>

Not Implemented

</details>

<details>

<summary>DotNet SDK</summary>

Not Implemented

</details>

<details>

<summary>Power Commander</summary>

**Command:** `Get-KeeperPasswordVisible`

Returns current password visibility setting (True or False).

**Example:**

```powershell
PS > Get-KeeperPasswordVisible
True

PS > Get-KeeperPasswordVisible
False
```

**Command:** `Set-KeeperPasswordVisible`

Toggles whether passwords are shown in plaintext or masked when displaying records.

**Flags**:\
`-Visible` — When present, passwords are shown in plaintext. When omitted, passwords are masked.

**Example:**

```powershell
PS > Set-KeeperPasswordVisible -Visible
PS > Get-KeeperRecord "MyRecord"   # password fields shown in plaintext

PS > Set-KeeperPasswordVisible
PS > Get-KeeperRecord "MyRecord"   # password fields shown as ••••••
```

</details>

<details>

<summary>Python CLI</summary>

Not Implemented

</details>

<details>

<summary>Python SDK</summary>

Not Implemented

</details>

### Show-Two Factor Code command

Displays information about the current authenticated user, including username and email.

<details>

<summary>DotNet CLI</summary>

Not Implemented

</details>

<details>

<summary>DotNet SDK</summary>

Not Implemented

</details>

<details>

<summary>Power Commander</summary>

**Command:** `Show-TwoFactorCode`

Description: Generates and displays TOTP codes for records with a oneTimeCode field. Shows code, elapsed, and remaining seconds.

**Flags**:\
-Records — Record UID(s) or objects (Required, pipeline)

**Example:**

```powershell
PS > Show-TwoFactorCode -Records "recordUid123"

PS > Get-KeeperRecord -Uid "abcDEF123" | 2fa
```

**Command:** `Set-KeeperPasswordVisible`

Toggles whether passwords are shown in plaintext or masked when displaying records.

**Flags**:\
`-Visible` — When present, passwords are shown in plaintext. When omitted, passwords are masked.

**Example:**

```powershell
PS > Set-KeeperPasswordVisible -Visible
PS > Get-KeeperRecord "MyRecord"   # password fields shown in plaintext

PS > Set-KeeperPasswordVisible
PS > Get-KeeperRecord "MyRecord"   # password fields shown as ••••••
```

</details>

<details>

<summary>Python CLI</summary>

Not Implemented

</details>

<details>

<summary>Python SDK</summary>

Not Implemented

</details>
