pacx auth create - neronotte/Greg.Xrm.Command GitHub Wiki
Create and store authentication profiles on this computer. Can be also used to update an existing authentication profile.
Usage
You have two alternative options to create an authentication profile:
- Providing a full Connection String
- Simply specifying an Environment URL
Connection String
This is the preferred method for most users. Supports all authentication methods valid for your environment. The valid options for the connection string definition are documented in this Microsoft Learn article
auth create -n MyProfile -cs "AuthType=ClientSecret;Url=https://contosotest.crm.dynamics.com;ClientId={AppId};ClientSecret={ClientSecret}"
auth create -n MyProfile -cs "AuthType=Office365;[email protected];Password=passcode;Url=https://contoso.crm.dynamics.com"
auth create -n MyProfile -cs "AuthType=OAuth;[email protected];Password=passcode;Url=https://contosotest.crm.dynamics.com;AppId=51f81489-12ee-4a9e-aaae-a2591f45987d;RedirectUri=app://58145B91-0C36-4500-8554-080854F2AC97;LoginPrompt=Auto
Environment URL
This is the preferred method for users who want to connect via OAuth. It will automatically use the OAuth flow to authenticate.
auth create -n MyProfile -env "https://contosotest.crm.dynamics.com"
Client ID / Secret
This is the preferred method for non interactive authentications.
auth create -n MyProfile -env "https://contosotest.crm.dynamics.com" -id "1CF992AE-7203-4722-A53D-034D18C4593A" -cs "REDACTED"
Arguments
| Long Name | Short Name | Required? | Description | Default value | Valid values |
|---|---|---|---|---|---|
name |
n |
Y | The name you want to give to this authentication profile (maximum 30 characters). | - | String |
environment |
env |
N | If you want to connect to your environment via OAuth or Client ID / Secret, specify the environment URL here. | - | String |
applicationId |
id |
N | The Application ID (Client ID) to authenticate with when using Client ID/Secret. | - | String |
clientSecret |
s |
N | The Client Secret to authenticate with when using Client ID/Secret. | - | String |
conn |
cs |
N | The connection string that will be used to connect to the dataverse. | - | String |