Skip to content

Commit

Permalink
Simplified login solving pnp#889
Browse files Browse the repository at this point in the history
  • Loading branch information
waldekmastykarz committed May 17, 2019
1 parent eedc46c commit 8fd1dbf
Show file tree
Hide file tree
Showing 834 changed files with 11,003 additions and 50,616 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
@@ -1,5 +1,6 @@
{
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
"editor.detectIndentation": false,
"typescript.tsdk": "node_modules/typescript/lib"
}
8 changes: 4 additions & 4 deletions docs/guides/adding-command.md
Expand Up @@ -71,7 +71,7 @@ class MyCommand extends Command {
Examples:
${chalk.grey(config.delimiter)} ${commands.MYCOMMAND}
${commands.MYCOMMAND}
example one of using the command
`);
}
Expand All @@ -80,7 +80,7 @@ class MyCommand extends Command {
module.exports = new MyCommand();
```

Depending on your command and the service for which you're building the command, there might be a base class that you can use to simplify the implementation. For example for SPO, you can inherit from the [SpoCommand](../../src/o365/spo/SpoCommand.ts) base class. This class automatically checks if the user logged in to SharePoint Online before running the command, simplifying your implementation.
Depending on your command and the service for which you're building the command, there might be a base class that you can use to simplify the implementation. For example for SPO, you can inherit from the [SpoCommand](../../src/o365/spo/SpoCommand.ts) base class. This class contains a number of helper methods simplifying your implementation.

### Tracking command usage

Expand Down Expand Up @@ -159,7 +159,7 @@ class SpoMyCommand extends Command {
Examples:
${chalk.grey(config.delimiter)} ${commands.MYCOMMAND}
${commands.MYCOMMAND}
example one of using the command
`);
}
Expand Down Expand Up @@ -199,7 +199,7 @@ Each command has a corresponding manual page. The contents of this page are almo
Start filling the help page contents by starting the Office 365 CLI and requesting help for your command:

```sh
o365$ help spo my-command
o365$ spo my-command --help
```

Copy the output of the command and use as a starting point for creating the documentation page. The main difference between the help displayed in the CLI and the manual page is the formatting. In the command line, the CLI uses chalk to emphasize information. The manual uses Markdown to format the output. To maintain consistency, refer to other manual pages to see how they are structured and how the information is presented.
Expand Down
12 changes: 6 additions & 6 deletions docs/manual/docs/about/comparison-powershell.md
Expand Up @@ -16,12 +16,12 @@ Add-SPOTheme|Microsoft.Online.SharePoint.PowerShell|[spo theme set](../cmd/spo/t
Add-SPOUser|Microsoft.Online.SharePoint.PowerShell|
Approve-SPOTenantServicePrincipalPermissionGrant|Microsoft.Online.SharePoint.PowerShell|[spo serviceprincipal grant add](../cmd/spo/serviceprincipal/serviceprincipal-grant-add.md)
Approve-SPOTenantServicePrincipalPermissionRequest|Microsoft.Online.SharePoint.PowerShell|[spo serviceprincipal permissionrequest approve](../cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-approve.md)
Connect-SPOService|Microsoft.Online.SharePoint.PowerShell|[spo login](../cmd/spo/login.md)
Connect-SPOService|Microsoft.Online.SharePoint.PowerShell|[spo login](../cmd/login.md)
ConvertTo-SPOMigrationEncryptedPackage|Microsoft.Online.SharePoint.PowerShell|
ConvertTo-SPOMigrationTargetedPackage|Microsoft.Online.SharePoint.PowerShell|
Deny-SPOTenantServicePrincipalPermissionRequest|Microsoft.Online.SharePoint.PowerShell|[spo serviceprincipal permissionrequest deny](../cmd/spo/serviceprincipal/serviceprincipal-permissionrequest-deny.md)
Disable-SPOTenantServicePrincipal|Microsoft.Online.SharePoint.PowerShell|[spo serviceprincipal set](../cmd/spo/serviceprincipal/serviceprincipal-set.md)
Disconnect-SPOService|Microsoft.Online.SharePoint.PowerShell|[spo logout](../cmd/spo/logout.md)
Disconnect-SPOService|Microsoft.Online.SharePoint.PowerShell|[spo logout](../cmd/logout.md)
Enable-SPOCommSite|Microsoft.Online.SharePoint.PowerShell|[spo site commsite enable](../cmd/spo/site/site-commsite-enable.md)
Enable-SPOTenantServicePrincipal|Microsoft.Online.SharePoint.PowerShell|[spo serviceprincipal set](../cmd/spo/serviceprincipal/serviceprincipal-set.md)
Export-SPOUserInfo|Microsoft.Online.SharePoint.PowerShell|
Expand Down Expand Up @@ -211,7 +211,7 @@ Clear-PnPRecycleBinItem|SharePointPnPPowerShellOnline|
Clear-PnPTenantRecycleBinItem|SharePointPnPPowerShellOnline|
Connect-PnPHubSite|SharePointPnPPowerShellOnline|[spo hubsite connect](../cmd/spo/hubsite/hubsite-connect.md)
Connect-PnPMicrosoftGraph|SharePointPnPPowerShellOnline|
Connect-PnPOnline|SharePointPnPPowerShellOnline|[spo login](../cmd/spo/login.md)
Connect-PnPOnline|SharePointPnPPowerShellOnline|[spo login](../cmd/login.md)
Convert-PnPFolderToProvisioningTemplate|SharePointPnPPowerShellOnline|
Convert-PnPProvisioningTemplate|SharePointPnPPowerShellOnline|
ConvertTo-PnPClientSidePage|SharePointPnPPowerShellOnline|
Expand All @@ -224,7 +224,7 @@ Disable-PnPResponsiveUI|SharePointPnPPowerShellOnline|
Disable-PnPSiteClassification|SharePointPnPPowerShellOnline|[graph siteclassification disable](../cmd/graph/siteclassification/siteclassification-disable.md)
Disable-PnPTenantServicePrincipal|SharePointPnPPowerShellOnline|[spo serviceprincipal set](../cmd/spo/serviceprincipal/serviceprincipal-set.md)
Disconnect-PnPHubSite|SharePointPnPPowerShellOnline|[spo hubsite disconnect](../cmd/spo/hubsite/hubsite-disconnect.md)
Disconnect-PnPOnline|SharePointPnPPowerShellOnline|[spo logout](../cmd/spo/logout.md)
Disconnect-PnPOnline|SharePointPnPPowerShellOnline|[spo logout](../cmd/logout.md)
Enable-PnPFeature|SharePointPnPPowerShellOnline|
Enable-PnPInPlaceRecordsManagementForSite|SharePointPnPPowerShellOnline|
Enable-PnPResponsiveUI|SharePointPnPPowerShellOnline|
Expand Down Expand Up @@ -612,8 +612,8 @@ Set-AdminPowerAppOwner|Microsoft.PowerApps.Administration.PowerShell|
Set-AdminPowerAppRoleAssignment|Microsoft.PowerApps.Administration.PowerShell|
Test-PowerAppsAccount|Microsoft.PowerApps.Administration.PowerShell|
Add-TeamUser|MicrosoftTeams|[graph teams user add](../cmd/graph/o365group/o365group-user-add.md)
Connect-MicrosoftTeams|MicrosoftTeams|[graph login](../cmd/graph/login.md)
Disconnect-MicrosoftTeams|MicrosoftTeams|[graph logout](../cmd/graph/logout.md)
Connect-MicrosoftTeams|MicrosoftTeams|[login](../cmd/login.md)
Disconnect-MicrosoftTeams|MicrosoftTeams|[logout](../cmd/logout.md)
Get-Team|MicrosoftTeams|[graph teams list](../cmd/graph/teams/teams-list.md)
Get-TeamChannel|MicrosoftTeams|[graph teams channel list](../cmd/graph/teams/teams-channel-list.md), [graph teams channel get](../cmd/graph/teams/teams-channel-get.md)
Get-TeamFunSettings|MicrosoftTeams|[graph teams funsettings list](../cmd/graph/teams/teams-funsettings-list.md)
Expand Down
24 changes: 12 additions & 12 deletions docs/manual/docs/about/release-notes.md
Expand Up @@ -480,9 +480,9 @@

**Azure Management Service:**

- [azmgmt login](../cmd/azmgmt/login.md) - log in to the Azure Management Service [#378](https://github.com/pnp/office365-cli/issues/378)
- [azmgmt logout](../cmd/azmgmt/logout.md) - log out from the Azure Management Service [#378](https://github.com/pnp/office365-cli/issues/378)
- [azmgmt status](../cmd/azmgmt/status.md) - shows Azure Management Service login status [#378](https://github.com/pnp/office365-cli/issues/378)
- azmgmt login - log in to the Azure Management Service [#378](https://github.com/pnp/office365-cli/issues/378)
- azmgmt logout - log out from the Azure Management Service [#378](https://github.com/pnp/office365-cli/issues/378)
- azmgmt status - shows Azure Management Service login status [#378](https://github.com/pnp/office365-cli/issues/378)
- [azmgmt flow environment get](../cmd/azmgmt/flow/flow-environment-get.md) - gets information about the specified Microsoft Flow environment [#380](https://github.com/pnp/office365-cli/issues/380)
- [azmgmt flow environment list](../cmd/azmgmt/flow/flow-environment-list.md) - lists Microsoft Flow environments in the current tenant [#379](https://github.com/pnp/office365-cli/issues/379)
- [azmgmt flow get](../cmd/azmgmt/flow/flow-get.md) - gets information about the specified Microsoft Flow [#382](https://github.com/pnp/office365-cli/issues/382)
Expand Down Expand Up @@ -526,9 +526,9 @@

**Microsoft Graph:**

- [graph login](../cmd/graph/login.md) - log in to the Microsoft Graph [#10](https://github.com/pnp/office365-cli/issues/10)
- [graph logout](../cmd/graph/logout.md) - log out from the Microsoft Graph [#10](https://github.com/pnp/office365-cli/issues/10)
- [graph status](../cmd/graph/status.md) - shows Microsoft Graph login status [#10](https://github.com/pnp/office365-cli/issues/10)
- graph - log in to the Microsoft Graph [#10](https://github.com/pnp/office365-cli/issues/10)
- graph - log out from the Microsoft Graph [#10](https://github.com/pnp/office365-cli/issues/10)
- graph - shows Microsoft Graph login status [#10](https://github.com/pnp/office365-cli/issues/10)
- [graph o365group add](../cmd/graph/o365group/o365group-add.md) - creates Office 365 Group [#308](https://github.com/pnp/office365-cli/issues/308)
- [graph o365group get](../cmd/graph/o365group/o365group-get.md) - gets information about the specified Office 365 Group [#306](https://github.com/pnp/office365-cli/issues/306)
- [graph o365group list](../cmd/graph/o365group/o365group-list.md) - lists Office 365 Groups in the current tenant [#305](https://github.com/pnp/office365-cli/issues/305)
Expand Down Expand Up @@ -614,9 +614,9 @@

**Azure Active Directory Graph:**

- [aad login](../cmd/aad/login.md) - log in to the Azure Active Directory Graph [#160](https://github.com/pnp/office365-cli/issues/160)
- [aad logout](../cmd/aad/logout.md) - log out from Azure Active Directory Graph [#161](https://github.com/pnp/office365-cli/issues/161)
- [aad status](../cmd/aad/status.md) - shows Azure Active Directory Graph login status [#162](https://github.com/pnp/office365-cli/issues/162)
- aad login - log in to the Azure Active Directory Graph [#160](https://github.com/pnp/office365-cli/issues/160)
- aad logout - log out from Azure Active Directory Graph [#161](https://github.com/pnp/office365-cli/issues/161)
- aad status - shows Azure Active Directory Graph login status [#162](https://github.com/pnp/office365-cli/issues/162)
- [aad sp get](../cmd/aad/sp/sp-get.md) - gets information about the specific service principal [#158](https://github.com/pnp/office365-cli/issues/158)
- [aad oauth2grant list](../cmd/aad/oauth2grant/oauth2grant-list.md) - lists OAuth2 permission grants for the specified service principal [#159](https://github.com/pnp/office365-cli/issues/159)
- [aad oauth2grant add](../cmd/aad/oauth2grant/oauth2grant-add.md) - grant the specified service principal OAuth2 permissions to the specified resource [#164](https://github.com/pnp/office365-cli/issues/164)
Expand Down Expand Up @@ -689,9 +689,9 @@ Initial release.
- [spo cdn policy list](../cmd/spo/cdn/cdn-policy-list.md) - list Office 365 CDN policies
- [spo cdn policy set](../cmd/spo/cdn/cdn-policy-set.md) - set Office 365 CDN policy
- [spo cdn set](../cmd/spo/cdn/cdn-set.md) - enable/disable Office 365 CDN
- [spo login](../cmd/spo/login.md) - log in to a SharePoint Online site
- [spo logout](../cmd/spo/logout.md) - log out from SharePoint
- [spo status](../cmd/spo/status.md) - show SharePoint Online login status
- spo login - log in to a SharePoint Online site
- spo logout - log out from SharePoint
- spo status - show SharePoint Online login status
- [spo storageentity get](../cmd/spo/storageentity/storageentity-get.md) - get value of a tenant property
- [spo storageentity list](../cmd/spo/storageentity/storageentity-list.md) - list all tenant properties
- [spo storageentity remove](../cmd/spo/storageentity/storageentity-remove.md) - remove a tenant property
Expand Down
72 changes: 0 additions & 72 deletions docs/manual/docs/cmd/aad/login.md

This file was deleted.

45 changes: 0 additions & 45 deletions docs/manual/docs/cmd/aad/logout.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/manual/docs/cmd/aad/oauth2grant/oauth2grant-add.md
Expand Up @@ -20,13 +20,8 @@ Option|Description
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

!!! important
Before using this command, log in to Azure Active Directory Graph, using the [aad login](../login.md) command.

## Remarks

To grant service principal OAuth2 permissions, you have to first log in to Azure Active Directory Graph using the [aad login](../login.md) command.

Before you can grant service principal OAuth2 permissions, you need its `objectId`. You can retrieve it using the [aad sp get](../sp/sp-get.md) command.

The resource for which you want to grant permissions is designated using its `objectId`. You can retrieve it using the [aad sp get](../sp/sp-get.md) command, the same way you would retrieve the `objectId` of the service principal.
Expand Down
5 changes: 0 additions & 5 deletions docs/manual/docs/cmd/aad/oauth2grant/oauth2grant-list.md
Expand Up @@ -18,13 +18,8 @@ Option|Description
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

!!! important
Before using this command, log in to Azure Active Directory Graph, using the [aad login](../login.md) command.

## Remarks

To get information about service principal OAuth2 permission grants, you have to first log in to Azure Active Directory Graph using the [aad login](../login.md) command, eg. `aad login`.

In order to list existing OAuth2 permissions granted to a service principal, you need its `objectId`. You can retrieve it using the [aad sp get](../sp/sp-get.md) command.

When using the text output type (default), the command lists only the values of the `objectId`, `resourceId` and `scope` properties of the OAuth grant. When setting the output type to JSON, all available properties are included in the command output.
Expand Down
5 changes: 0 additions & 5 deletions docs/manual/docs/cmd/aad/oauth2grant/oauth2grant-remove.md
Expand Up @@ -18,13 +18,8 @@ Option|Description
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

!!! important
Before using this command, log in to Azure Active Directory Graph, using the [aad login](../login.md) command.

## Remarks

To remove service principal's OAuth2 permissions, you have to first log in to Azure Active Directory Graph using the [aad login](../login.md) command, eg. `aad login`.

Before you can remove service principal's OAuth2 permissions, you need to get the `objectId` of the permissions grant to remove. You can retrieve it using the [aad oauth2grant list](./oauth2grant-list.md) command.

If the `objectId` listed when using the [aad oauth2grant list](./oauth2grant-list.md) command has a minus sign ('-') prefix, you may receive an error indicating `--grantId` is missing. To resolve this issue simply escape the leading '-'.
Expand Down
5 changes: 0 additions & 5 deletions docs/manual/docs/cmd/aad/oauth2grant/oauth2grant-set.md
Expand Up @@ -19,13 +19,8 @@ Option|Description
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

!!! important
Before using this command, log in to Azure Active Directory Graph, using the [aad login](../login.md) command.

## Remarks

To update service principal's OAuth2 permissions, you have to first log in to Azure Active Directory Graph using the [aad login](../login.md) command, eg. `aad login`.

Before you can update service principal's OAuth2 permissions, you need to get the `objectId` of the permissions grant to update. You can retrieve it using the [aad oauth2grant list](./oauth2grant-list.md) command.

If the `objectId` listed when using the [aad oauth2grant list](./oauth2grant-list.md) command has a minus sign ('-') prefix, you may receive an error indicating `--grantId` is missing. To resolve this issue simply escape the leading '-'.
Expand Down
5 changes: 0 additions & 5 deletions docs/manual/docs/cmd/aad/sp/sp-get.md
Expand Up @@ -19,13 +19,8 @@ Option|Description
`--verbose`|Runs command with verbose logging
`--debug`|Runs command with debug logging

!!! important
Before using this command, log in to Azure Active Directory Graph, using the [aad login](../login.md) command.

## Remarks

To get information about a service principal, you have to first log in to Azure Active Directory Graph using the [aad login](../login.md) command, eg. `aad login`.

When looking up information about a service principal you should specify either its `appId` or `displayName` but not both. If you specify both values, the command will fail with an error.

## Examples
Expand Down

0 comments on commit 8fd1dbf

Please sign in to comment.