-
Notifications
You must be signed in to change notification settings - Fork 329
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds multiple account functionality. Closes #3587
- Loading branch information
1 parent
d53f0d9
commit d4a8bee
Showing
28 changed files
with
2,054 additions
and
317 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,7 @@ const dictionary = [ | |
'historical', | ||
'home', | ||
'hub', | ||
'identity', | ||
'in', | ||
'info', | ||
'inheritance', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
import Global from '/docs/cmd/_global.mdx'; | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# identity list | ||
|
||
Shows a list of currently signed in identities | ||
|
||
## Usage | ||
|
||
```sh | ||
m365 identity list [options] | ||
``` | ||
|
||
## Options | ||
|
||
<Global /> | ||
|
||
## Remarks | ||
|
||
If you are logged in to Microsoft 365, the `identity list` command will show you a list of users and/or applications used to sign in and the details about the stored refresh and access tokens and their expiration date and time when run in debug mode. | ||
|
||
## Examples | ||
|
||
Show the list of available identities used to sign in to Microsoft 365 | ||
|
||
```sh | ||
m365 identity list | ||
``` | ||
|
||
## Response | ||
|
||
<Tabs> | ||
<TabItem value="JSON"> | ||
|
||
```json | ||
[ | ||
{ | ||
"connectedAs": "[email protected]", | ||
"identityId": "028de82d-7fd9-476e-a9fd-be9714280ff3", | ||
"authType": "DeviceCode", | ||
"appId": "31359c7f-bd7e-475c-86db-fdb8c937548e", | ||
"appTenant": "common", | ||
"cloudType": "Public" | ||
}, | ||
{ | ||
"connectedAs": "Contoso Application", | ||
"identityId": "acd6df42-10a9-4315-8928-53334f1c9d01", | ||
"authType": "Secret", | ||
"appId": "39446e2e-5081-4887-980c-f285919fccca", | ||
"appTenant": "db308122-52f3-4241-af92-1734aa6e2e50", | ||
"cloudType": "Public" | ||
} | ||
] | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Text"> | ||
|
||
```text | ||
connectedAs authType | ||
------------------------------------ ----------------------------------------------- | ||
[email protected] DeviceCode | ||
Contoso Application Secret | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="CSV"> | ||
|
||
```csv | ||
connectedAs,identityId,authType,appId,appTenant,cloudType | ||
[email protected],028de82d-7fd9-476e-a9fd-be9714280ff3,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public | ||
Contoso Application,acd6df42-10a9-4315-8928-53334f1c9d01,Secret,39446e2e-5081-4887-980c-f285919fccca,db308122-52f3-4241-af92-1734aa6e2e50,Public | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Markdown"> | ||
|
||
```md | ||
# identity list | ||
|
||
Date: 7/2/2023 | ||
|
||
Property | Value | ||
---------|------- | ||
connectedAs | [email protected] | ||
identityId | 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
authType | DeviceCode | ||
appId | 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
appTenant | common | ||
cloudType | Public | ||
|
||
Property | Value | ||
---------|------- | ||
connectedAs | Contoso Application | ||
identityId | acd6df42-10a9-4315-8928-53334f1c9d01 | ||
authType | Secret | ||
appId | 39446e2e-5081-4887-980c-f285919fccca | ||
appTenant | db308122-52f3-4241-af92-1734aa6e2e50 | ||
cloudType | Public | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
import Global from '/docs/cmd/_global.mdx'; | ||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# identity set | ||
|
||
Switches to another identity, when signed into multiple identities | ||
|
||
## Usage | ||
|
||
```sh | ||
m365 identity set [options] | ||
``` | ||
|
||
## Options | ||
|
||
```md definition-list | ||
`-i, --id [id]` | ||
: The Id (GUID) of the identity to switch to. Specify either `id` or `name` but not both. | ||
|
||
`-n, --name [name]` | ||
: The name of the identity to switch to. Specify either `id` or `name` but not both. | ||
``` | ||
|
||
<Global /> | ||
|
||
## Remarks | ||
|
||
The values for `--id` or `--name` can be found by running [m365 identity list](identity-list.mdx). | ||
|
||
## Examples | ||
|
||
Switch to a user identity by name | ||
|
||
```sh | ||
m365 identity set --name '[email protected]' | ||
``` | ||
|
||
Switch to a given identity by id | ||
|
||
```sh | ||
m365 identity set --id '6e70c8ea-571d-4daf-bc48-9e1b49ac3390' | ||
``` | ||
|
||
Switch to an application identity by name | ||
|
||
```sh | ||
m365 identity set --name 'My contoso application' | ||
``` | ||
|
||
## Response | ||
|
||
<Tabs> | ||
<TabItem value="JSON"> | ||
|
||
```json | ||
{ | ||
"connectedAs": "[email protected]", | ||
"identityId": "028de82d-7fd9-476e-a9fd-be9714280ff3", | ||
"authType": "DeviceCode", | ||
"appId": "31359c7f-bd7e-475c-86db-fdb8c937548e", | ||
"appTenant": "common", | ||
"cloudType": "Public" | ||
} | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Text"> | ||
|
||
```text | ||
appId : 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
identityId : 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
appTenant : common | ||
authType : DeviceCode | ||
connectedAs: [email protected] | ||
cloudType : Public | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="CSV"> | ||
|
||
```csv | ||
connectedAs,authType,appId,appTenant,cloudType | ||
[email protected],028de82d-7fd9-476e-a9fd-be9714280ff3,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="Markdown"> | ||
|
||
```md | ||
# identity set | ||
|
||
Date: 7/2/2023 | ||
|
||
Property | Value | ||
---------|------- | ||
connectedAs | [email protected] | ||
identityId | 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
authType | DeviceCode | ||
appId | 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
appTenant | common | ||
cloudType | Public | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -186,7 +186,8 @@ m365 login --authType secret --secret topSeCr3t@007 | |
Upon successful login: | ||
```json | ||
{ | ||
"connectedAs": "[email protected]", | ||
"connectedAs": "[email protected]", | ||
"identityId": "028de82d-7fd9-476e-a9fd-be9714280ff3", | ||
"authType": "DeviceCode", | ||
"appId": "31359c7f-bd7e-475c-86db-fdb8c937548e", | ||
"appTenant": "common", | ||
|
@@ -203,9 +204,10 @@ m365 login --authType secret --secret topSeCr3t@007 | |
Upon successful login: | ||
```text | ||
appId : 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
identityId : 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
appTenant : common | ||
authType : DeviceCode | ||
connectedAs: john.doe@contoso.onmicrosoft.com, | ||
connectedAs: alexw@contoso.com | ||
cloudType : Public | ||
``` | ||
|
||
|
@@ -218,7 +220,7 @@ m365 login --authType secret --secret topSeCr3t@007 | |
Upon successful login: | ||
```csv | ||
connectedAs,authType,appId,appTenant,cloudType | ||
john.doe@contoso.onmicrosoft.com,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public | ||
alexw@contoso.com,028de82d-7fd9-476e-a9fd-be9714280ff3,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public | ||
``` | ||
|
||
</TabItem> | ||
|
@@ -233,11 +235,10 @@ m365 login --authType secret --secret topSeCr3t@007 | |
|
||
Date: 7/2/2023 | ||
|
||
|
||
|
||
Property | Value | ||
---------|------- | ||
connectedAs | [email protected] | ||
connectedAs | [email protected] | ||
identityId | 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
authType | DeviceCode | ||
appId | 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
appTenant | common | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,11 +12,21 @@ m365 logout [options] | |
|
||
## Options | ||
|
||
```md definition-list | ||
`-i, --identityId [identityId]` | ||
: The optional Id (GUID) of the identity to logout from. Specify either `identityId` or `identityName` but not both. If not specified, all identities will be logged out from. | ||
|
||
`-n, --identityName [identityName]` | ||
: The optional name of the identity to switch to. Specify either `identityId` or `identityName` but not both. If not specified, all identities will be logged out from. | ||
``` | ||
|
||
<Global /> | ||
|
||
## Remarks | ||
|
||
The `logout` command logs out from Microsoft 365 and removes any access and refresh tokens from memory | ||
The `logout` command logs out from Microsoft 365 and removes any access and refresh tokens from memory. | ||
|
||
The values for `--identityId` or `--identityName` can be found by running [m365 identity list](identity/identity-list.mdx). | ||
|
||
## Examples | ||
|
||
|
@@ -26,10 +36,22 @@ Log out from Microsoft 365 | |
m365 logout | ||
``` | ||
|
||
Log out from Microsoft 365 in debug mode including detailed debug information in the console output | ||
Log out from a given user identity by name | ||
|
||
```sh | ||
m365 logout --identityName '[email protected]' | ||
``` | ||
|
||
Log out from a given application identity by name | ||
|
||
```sh | ||
m365 logout --identityName 'My contoso application' | ||
``` | ||
|
||
Log out from a given identity by id | ||
|
||
```sh | ||
m365 logout --debug | ||
m365 logout --identityId '23269cc7-c005-4a36-b020-b6e99f997710' | ||
``` | ||
|
||
## Response | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,8 @@ m365 status | |
|
||
```json | ||
{ | ||
"connectedAs": "[email protected]", | ||
"connectedAs": "[email protected]", | ||
"identityId": "028de82d-7fd9-476e-a9fd-be9714280ff3", | ||
"authType": "DeviceCode", | ||
"appId": "31359c7f-bd7e-475c-86db-fdb8c937548e", | ||
"appTenant": "common", | ||
|
@@ -48,9 +49,10 @@ m365 status | |
|
||
```text | ||
appId : 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
identityId : 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
appTenant : common | ||
authType : DeviceCode | ||
connectedAs: john.doe@contoso.onmicrosoft.com | ||
connectedAs: alexw@contoso.com | ||
cloudType : Public | ||
``` | ||
|
||
|
@@ -59,7 +61,7 @@ m365 status | |
|
||
```csv | ||
connectedAs,authType,appId,appTenant,cloudType | ||
john.doe@contoso.onmicrosoft.com,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public | ||
alexw@contoso.com,028de82d-7fd9-476e-a9fd-be9714280ff3,DeviceCode,31359c7f-bd7e-475c-86db-fdb8c937548e,common,Public | ||
``` | ||
|
||
</TabItem> | ||
|
@@ -70,11 +72,10 @@ m365 status | |
|
||
Date: 7/2/2023 | ||
|
||
|
||
|
||
Property | Value | ||
---------|------- | ||
connectedAs | [email protected] | ||
connectedAs | [email protected] | ||
identityId | 028de82d-7fd9-476e-a9fd-be9714280ff3 | ||
authType | DeviceCode | ||
appId | 31359c7f-bd7e-475c-86db-fdb8c937548e | ||
appTenant | common | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.