You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
> **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.
82
82
83
83
### How to use
84
84
85
85
- 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.
88
88
- If you are writing a server side application,
89
89
- [Select a credential from \`@azure/identity\` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples)
90
90
- Complete the set up steps required by the credential if any.
91
91
- 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.
94
92
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.
95
95
96
96
#### nodejs - Authentication, client creation, and ${operationHeader} as an example written in JavaScript.
97
97
@@ -142,7 +142,7 @@ In browser applications, we recommend using the \`InteractiveBrowserCredential\`
142
142
const credential = new InteractiveBrowserCredential(
143
143
{
144
144
clientId: "<client id for your Azure AD app>",
145
-
tenant: "<optional tenant for your organization>"
145
+
tenantId: "<optional tenant for your organization>"
146
146
});
147
147
const client = new ${namespace}.${clientName}(creds, subscriptionId);
0 commit comments