# Vendia CLI command - auth

## `share auth`

Login, logout & manage your Vendia account.

### Commands for `share auth`

Manage authorization & set current Vendia user.

### Usage for `share auth`

```
share auth <subcommand>
```

| Subcommand                                           | Description                          |
| :-------------------------------------------------- | :----------------------------------- |
| [`auth login`](https://docs.vendia.com/platform/cli/commands/auth#auth-login)               | Login to Vendia user account        |
| [`auth logout`](https://docs.vendia.com/platform/cli/commands/auth#auth-logout)             | Logout of Vendia user account       |
| [`auth role`](https://docs.vendia.com/platform/cli/commands/auth#auth-role)                 | Manage roles for users              |
| [`auth role delete`](https://docs.vendia.com/platform/cli/commands/auth#auth-role-delete)   | Delete roles for users              |
| [`auth role get`](https://docs.vendia.com/platform/cli/commands/auth#auth-role-get)         | Get role information                |
| [`auth role list`](https://docs.vendia.com/platform/cli/commands/auth#auth-role-list)       | List roles for user                 |
| [`auth role set`](https://docs.vendia.com/platform/cli/commands/auth#auth-role-set)         | Set Roles for user                  |
| [`auth switch`](https://docs.vendia.com/platform/cli/commands/auth#auth-switch)             | Switch active Vendia account        |
| [`auth whoami`](https://docs.vendia.com/platform/cli/commands/auth#auth-whoami)           | Display active Vendia account       |

### Examples for `share auth`

```
❯ Login to Vendia

share login

# Login to new account

share login --new

# Login programmatically

share login --email your@email.com --password *******

❯ Logout of Vendia

share logout

# Logout of all accounts

share logout --all

❯ Switch user accounts

share auth switch

share auth switch --email xyz@abc.com

❯ Show current user

share auth whoami
```

## `auth login`

Login to Vendia user account.

### Usage for `auth login`

```
share auth login
```

### Flags for `auth login`

- `new` ( _boolean_) \- Login to new Vendia account
- `email` ( _option_) \- User email
- `password` ( _option_) \- User password

### Examples for `auth login`

```
share login

# Login to new account

share login --new

# Login programmatically

share login --email your@email.com --password *******
```

## `auth logout`

Logout of Vendia user account.

### Usage for `auth logout`

```
share auth logout
```

### Flags for `auth logout`

- `all` ( _boolean_) \- Logout of all accounts on this machine

### Examples for `auth logout`

```
share logout

# Logout of all accounts

share logout --all
```

## `auth role`

Manage roles for users.

See [RBAC documentation](https://docs.vendia.com/platform/operational/secure-data-sharing/rbac) for additional information.

### Usage for `auth role`

```
share auth role <SubCommand>
```

### Examples for `auth role`

```
❯ List user roles

# Get all roles for current user

share auth role list

# Get all details about user

share auth role list --user email@email.com

# Return role details as json

share auth role list --json

❯ Get user role details

share auth role get <RoleName>

# Return role details as json

share auth role get <RoleName> --json

❯ Set user roles

share auth role set ./policy.json

share auth role set '{ name: "my-role", "capabilities": [...] }'

share auth role set ./policy.json --user email@email.com

share auth role set ./policy.json --user email@email.com --as-role my-admin-role

❯ Delete user roles

share auth role delete <RoleName>

share auth role delete <RoleName> --user email@email.com

share auth role delete <RoleName> --user email@email.com --as-role my-admin-role
```

## `auth role delete`

Delete roles for users.

### Usage for `auth role delete`

```
share auth role delete
```

### Arguments for `auth role delete`

- roleName - undefined

### Flags for `auth role delete`

- `as-role` ( _option_) \- Role name to use for the operation
- `user` ( _option_) \- User email

### Examples for `auth role delete`

```
share auth role delete <RoleName>

share auth role delete <RoleName> --user email@email.com

share auth role delete <RoleName> --user email@email.com --as-role my-admin-role
```

## `auth role get`

Get role information.

### Usage for `auth role get`

```
share auth role get
```

### Arguments for `auth role get`

- roleName - undefined

### Flags for `auth role get`

- `user` ( _option_) \- User email

### Examples for `auth role get`

```
share auth role get <RoleName>

# Return role details as json

share auth role get <RoleName> --json
```

## `auth role list`

List roles for user.

### Usage for `auth role list`

```
share auth role list
```

### Flags for `auth role list`

- `user` ( _option_) \- User email

### Examples for `auth role list`

```
# Get all roles for current user

share auth role list

# Get all details about user

share auth role list --user email@email.com

# Return role details as json

share auth role list --json
```

## `auth role set`

Set Roles for user.

See [RBAC documentation](https://docs.vendia.com/platform/operational/secure-data-sharing/rbac) for additional information.

### Usage for `auth role set`

```
share auth role set
```

### Arguments for `auth role set`

- roleName - undefined

### Flags for `auth role set`

- `policy` ( _option_) \- Policy document
- `as-role` ( _option_) \- Role name to use for the operation
- `user` ( _option_) \- User email

### Examples for `auth role set`

```
share auth role set ./policy.json

share auth role set '{ name: "my-role", "capabilities": [...] }'

share auth role set ./policy.json --user email@email.com

share auth role set ./policy.json --user email@email.com --as-role my-admin-role
```

## `auth switch`

Switch active Vendia account.

### Usage for `auth switch`

```
share auth switch
```

### Flags for `auth switch`

- `email` ( _option_) \- User email

### Examples for `auth switch`

```
share auth switch

share auth switch --email xyz@abc.com
```

## `auth whoami`

Display active Vendia account.

### Usage for `auth whoami`

```
share auth whoami
```

### Examples for `auth whoami`

```
share auth whoami
```
