Skip to content

Commit f046c5e

Browse files
authored
Update add-identity-mgmt-lib script to rely more on AzureIdentityExamples.md (Azure#15348)
In the past few weeks, I've had better insights to the pre-requisites for doing auth in the browser. We would want the generated code for mgmt plane packages to have all this info, but to avoid having the same information in multiple places, I have added it to the AzureIdentityExamples.md file
1 parent f0973fa commit f046c5e

File tree

2 files changed

+45
-25
lines changed

2 files changed

+45
-25
lines changed

common/tools/add-identity-mgmt-lib.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,20 +78,20 @@ npm install --save ${pkgName} @azure/identity
7878
\`\`\`
7979
8080
> **Note**: You may have used either \`@azure/ms-rest-nodeauth\` or \`@azure/ms-rest-browserauth\` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features.
81-
We strongly encourage you to upgrade to \`@azure/identity\` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
81+
If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to \`@azure/identity\` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options.
8282
8383
### How to use
8484
8585
- If you are writing a client side browser application,
86-
- See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser.
87-
- Note down the client Id from the previous step and use it in the browser sample below.
86+
- Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions.
87+
- Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below.
8888
- If you are writing a server side application,
8989
- [Select a credential from \`@azure/identity\` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
9090
- Complete the set up steps required by the credential if any.
9191
- Use the credential you picked in the place of \`DefaultAzureCredential\` in the Node.js sample below.
92-
- Pass the credential and the Azure subscription id to instantiate the client.
93-
- Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
9492
93+
In the below samples, we pass the credential and the Azure subscription id to instantiate the client.
94+
Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started.
9595
9696
#### nodejs - Authentication, client creation, and ${operationHeader} as an example written in JavaScript.
9797
@@ -142,7 +142,7 @@ In browser applications, we recommend using the \`InteractiveBrowserCredential\`
142142
const credential = new InteractiveBrowserCredential(
143143
{
144144
clientId: "<client id for your Azure AD app>",
145-
tenant: "<optional tenant for your organization>"
145+
tenantId: "<optional tenant for your organization>"
146146
});
147147
const client = new ${namespace}.${clientName}(creds, subscriptionId);
148148
const resourceGroupName = "testresourceGroupName";

0 commit comments

Comments
 (0)