Skip to content

Commit e1c54d4

Browse files
fix: update auth instructions for agent preview (#123)
* fix(agent preview): update auth instructions * W-1824708: edit messages for updated "agent preview" help (#124) * fix: edit cristian's messages * Update agent.preview.md --------- Co-authored-by: Juliet Shackell <[email protected]>
1 parent f32d6f5 commit e1c54d4

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

messages/agent.preview.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,50 @@ When the session concludes, the command asks if you want to save the API respons
1313
Find the agent's API name in its main details page in your org's Agent page in Setup.
1414

1515
Before you use this command, you must complete these steps:
16+
-----------------------------------------------------------
1617

17-
1. Create a connected app in your org as described in the "Create a Connected App" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these two additional steps:
18+
1. Create a connected app in your org as described in the "Create a Connected App" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#create-a-connected-app. Do these four additional steps:
1819

19-
a. When specifying the connected app's Callback URL, add this second callback URL on a new line: http://localhost:1717/OauthRedirect
20+
a. When specifying the connected app's Callback URL, add this second callback URL on a new line: "http://localhost:1717/OauthRedirect".
2021

21-
b. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
22+
b. When adding the scopes to the connected app, add "Manage user data via Web browsers (web)".
23+
24+
c. Ensure that the "Require Secret for Web Server Flow" option is not selected.
25+
26+
d. Make note of the user that you specified as the "Run As" user when updating the Client Credentials Flow section.
2227

2328
2. Add the connected app to your agent as described in the "Add Connected App to Agent" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#add-connected-app-to-agent.
2429

25-
3. Using the username of the user you specified as the "Run As" user above, authorize your org using the JWT flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm.
30+
3. Copy the consumer key from your connected app as described in the "Obtain Credentials" section here: https://developer.salesforce.com/docs/einstein/genai/guide/agent-api-get-started.html#obtain-credentials.
31+
32+
4. Set the "SFDX_AUTH_SCOPES" environment variable to "refresh_token sfap_api chatbot_api web api". This step ensures that you get the specific OAuth scopes required by this command.
33+
34+
5. Using the username of the user you specified as the "Run As" user above, authorize your org using the web server flow, as described in this document: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_web_flow.htm.
35+
36+
IMPORTANT: You must use the "--client-id <CONNECTED-APP-CONSUMER-KEY>" flag of "org login web", where CONNECTED-APP-CONSUMER-KEY is the consumer key you previously copied. This step ensures that the "org login web" command uses your custom connected app, and not the default CLI connected app.
37+
38+
Press Enter to skip sharing the client secret.
2639

27-
4. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.
40+
6. When you run this command to interact with an agent, specify the username you authorized in the preceding step with the --connected-app-user (-a) flag.
2841

2942
# flags.api-name.summary
3043

3144
API name of the agent you want to interact with.
3245

3346
# flags.connected-app-user.summary
3447

35-
Username or alias of the connected app user that's configured with JWT-based access tokens to the agent.
48+
Username or alias of the connected app user that's configured with web-based access tokens to the agent.
3649

3750
# flags.output-dir.summary
3851

3952
Directory where conversation transcripts are saved.
4053

4154
# examples
4255

43-
- Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using the alias "my-jwt-user"; this alias must point to the username who is authorized using JWT:
56+
- Interact with an agent with API name "Resort_Manager" in the org with alias "my-org". Connect to your agent using the alias "my-agent-user"; this alias must point to the username who is authorized using the Web server flow:
4457

45-
<%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user
58+
<%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user
4659

4760
- Same as the preceding example, but this time save the conversation transcripts to the "./transcripts/my-preview" directory rather than the default "./temp/agent-preview":
4861

49-
<%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-jwt-user --output-dir "transcripts/my-preview"
62+
<%= config.bin %> <%= command.id %> --api-name "Resort_Manager" --target-org my-org --connected-app-user my-agent-user --output-dir "transcripts/my-preview"

0 commit comments

Comments
 (0)