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
Copy file name to clipboardExpand all lines: articles/event-hubs/authenticate-application.md
+9-19Lines changed: 9 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Authenticate an application to access Azure Event Hubs resources
3
3
description: This article provides information about authenticating an application with Azure Active Directory to access Azure Event Hubs resources
4
4
ms.topic: conceptual
5
-
ms.date: 06/14/2021
5
+
ms.date: 11/08/2022
6
6
ms.custom: subject-rbac-steps
7
7
---
8
8
@@ -35,32 +35,21 @@ The following sections show you how to configure your native application or web
35
35
For an overview of the OAuth 2.0 code grant flow, see [Authorize access to Azure Active Directory web applications using the OAuth 2.0 code grant flow](../active-directory/develop/v2-oauth2-auth-code-flow.md).
36
36
37
37
### Register your application with an Azure AD tenant
38
-
The first step in using Azure AD to authorize Event Hubs resources is registering your client application with an Azure AD tenant from the [Azure portal](https://portal.azure.com/). When you register your client application, you supply information about the application to AD. Azure AD then provides a client ID (also called an application ID) that you can use to associate your application with Azure AD runtime. To learn more about the client ID, see [Application and service principal objects in Azure Active Directory](../active-directory/develop/app-objects-and-service-principals.md).
38
+
The first step in using Azure AD to authorize Event Hubs resources is registering your client application with an Azure AD tenant from the [Azure portal](https://portal.azure.com/). Follow steps in the [Quickstart: Register an application with the Microsoft identity platform](../active-directory/develop/quickstart-register-app.md)to register an application in Azure AD that represents your application trying to access Event Hubs resources.
39
39
40
-
The following images show steps for registering a web application:
40
+
When you register your client application, you supply information about the application to AD. Azure AD then provides a client ID (also called an application ID) that you can use to associate your application with Azure AD runtime. To learn more about the client ID, see [Application and service principal objects in Azure Active Directory](../active-directory/develop/app-objects-and-service-principals.md).
41
41
42
-

43
42
44
43
> [!Note]
45
44
> If you register your application as a native application, you can specify any valid URI for the Redirect URI. For native applications, this value does not have to be a real URL. For web applications, the redirect URI must be a valid URI, because it specifies the URL to which tokens are provided.
46
45
47
46
After you've registered your application, you'll see the **Application (client) ID** under **Settings**:
48
47
49
-

50
-
51
-
For more information about registering an application with Azure AD, see [Integrating applications with Azure Active Directory](../active-directory/develop/quickstart-register-app.md).
48
+
:::image type="content" source="./media/authenticate-application/application-id.png" alt-text="Screenshot showing the app registration page with application ID highlighted.":::
52
49
53
50
54
51
### Create a client secret
55
-
The application needs a client secret to prove its identity when requesting a token. To add the client secret, follow these steps.
56
-
57
-
1. Navigate to your app registration in the Azure portal.
58
-
1. Select the **Certificates & secrets** setting.
59
-
1. Under **Client secrets**, select **New client secret** to create a new secret.
60
-
1. Provide a description for the secret, and choose the wanted expiration interval.
61
-
1. Immediately copy the value of the new secret to a secure location. The fill value is displayed to you only once.
The application needs a client secret to prove its identity when requesting a token. Follow steps from [Add a client secret](../active-directory/develop/quickstart-register-app.md#add-a-client-secret) to create a client secret for your app in Azure AD.
64
53
65
54
66
55
## Assign Azure roles using the Azure portal
@@ -72,15 +61,16 @@ Once you define the role and its scope, you can test this behavior with samples
72
61
### Client libraries for token acquisition
73
62
Once you've registered your application and granted it permissions to send/receive data in Azure Event Hubs, you can add code to your application to authenticate a security principal and acquire OAuth 2.0 token. To authenticate and acquire the token, you can use either one of the [Microsoft identity platform authentication libraries](../active-directory/develop/reference-v2-libraries.md) or another open-source library that supports OpenID or Connect 1.0. Your application can then use the access token to authorize a request against Azure Event Hubs.
74
63
75
-
For a list of scenarios for which acquiring tokens is supported, see the [Scenarios](https://aka.ms/msal-net-scenarios) section of the [Microsoft Authentication Library (MSAL) for .NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) GitHub repository.
64
+
For scenarios where acquiring tokens is supported, see the [Scenarios](https://aka.ms/msal-net-scenarios) section of the [Microsoft Authentication Library (MSAL) for .NET](https://github.com/AzureAD/microsoft-authentication-library-for-dotnet) GitHub repository.
These samples use the old **Microsoft.Azure.EventHubs** library, but you can easily update it to using the latest **Azure.Messaging.EventHubs** library. To move the sample from using the old library to new one, see the [Guide to migrate from Microsoft.Azure.EventHubs to Azure.Messaging.EventHubs](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/eventhub/Azure.Messaging.EventHubs/MigrationGuide.md).
0 commit comments