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
#Customer intent: As an application developer, I want to learn how my Java app can get an access token and call an API that's protected by Microsoft identity platform endpoint using client credentials flow.
@@ -56,54 +56,35 @@ To register your application and add the app's registration information to your
56
56
1. Under **User** node, select **User.Read.All**, then select **Add permissions**.
57
57
58
58
#### Step 2: Download the Java project
59
+
[Download the Java daemon project](https://github.com/Azure-Samples/ms-identity-java-daemon/archive/master.zip)
59
60
60
-
> [!div renderon="docs"]
61
-
> [Download the Java daemon project](https://github.com/Azure-Samples/ms-identity-java-daemon/archive/master.zip)
> [Download the code sample](https://github.com/Azure-Samples/ms-identity-java-daemon/archive/master.zip)
65
-
66
-
> [!div class="sxs-lookup" renderon="portal"]
67
-
> > [!NOTE]
68
-
> > `Enter_the_Supported_Account_Info_Here`
69
-
70
-
> [!div renderon="docs"]
71
-
> #### Step 3: Configure the Java project
72
-
>
73
-
> 1. Extract the zip file to a local folder close to the root of the disk, for example, *C:\Azure-Samples*.
74
-
> 1. Navigate to the sub folder **msal-client-credential-secret**.
75
-
> 1. Edit *src\main\resources\application.properties* and replace the values of the fields `AUTHORITY`, `CLIENT_ID`, and `SECRET` with the following snippet:
> - `Enter_the_Application_Id_Here` - is the **Application (client) ID** for the application you registered.
84
-
> - `Enter_the_Tenant_Id_Here` - replace this value with the **Tenant Id** or **Tenant name** (for example, contoso.microsoft.com).
85
-
> - `Enter_the_Client_Secret_Here` - replace this value with the client secret created on step 1.
86
-
>
87
-
> > [!TIP]
88
-
> > To find the values of **Application (client) ID**, **Directory (tenant) ID**, go to the app's **Overview** page in the Azure portal. To generate a new key, go to **Certificates & secrets** page.
89
-
90
-
> [!div class="sxs-lookup" renderon="portal"]
91
-
> #### Step 3: Admin consent
92
-
93
-
> [!div renderon="docs"]
94
-
> #### Step 4: Admin consent
61
+
#### Step 3: Configure the Java project
62
+
63
+
1. Extract the zip file to a local folder close to the root of the disk, for example, *C:\Azure-Samples*.
64
+
1. Navigate to the sub folder **msal-client-credential-secret**.
65
+
1. Edit *src\main\resources\application.properties* and replace the values of the fields `AUTHORITY`, `CLIENT_ID`, and `SECRET` with the following snippet:
-`Enter_the_Application_Id_Here` - is the **Application (client) ID** for the application you registered.
74
+
-`Enter_the_Tenant_Id_Here` - replace this value with the **Tenant Id** or **Tenant name** (for example, contoso.microsoft.com).
75
+
-`Enter_the_Client_Secret_Here` - replace this value with the client secret created on step 1.
76
+
77
+
>[!TIP]
78
+
>To find the values of **Application (client) ID**, **Directory (tenant) ID**, go to the app's **Overview** page in the Azure portal. To generate a new key, go to **Certificates & secrets** page.
79
+
80
+
#### Step 4: Admin consent
95
81
96
82
If you try to run the application at this point, you'll receive *HTTP 403 - Forbidden* error: `Insufficient privileges to complete the operation`. This error happens because any *app-only permission* requires Admin consent: a global administrator of your directory must give consent to your application. Select one of the options below depending on your role:
97
83
98
84
##### Global tenant administrator
99
85
100
-
> [!div renderon="docs"]
101
-
> If you are a global tenant administrator, go to **API Permissions** page in **App registrations** in the Azure portal and select **Grant admin consent for {Tenant Name}** (Where {Tenant Name} is the name of your directory).
102
86
103
-
> [!div renderon="portal" class="sxs-lookup"]
104
-
> If you are a global administrator, go to **API Permissions** page select **Grant admin consent for Enter_the_Tenant_Name_Here**.
105
-
> > [!div id="apipermissionspage"]
106
-
> > [Go to the API Permissions page]()
87
+
If you are a global tenant administrator, go to **API Permissions** page in **App registrations** in the Azure portal and select **Grant admin consent for {Tenant Name}** (Where {Tenant Name} is the name of your directory).
107
88
108
89
##### Standard user
109
90
@@ -113,16 +94,12 @@ If you're a standard user of your tenant, then you need to ask a global administ
@@ -134,11 +134,6 @@ This quickstart application uses a client secret to identify itself as a confide
134
134
## More information
135
135
This section gives an overview of the code required to sign in users. This overview can be useful to understand how the code works, what the main arguments are, and how to add sign-in to an existing .NET Core console application.
136
136
137
-
> [!div class="sxs-lookup" renderon="portal"]
138
-
> ### How the sample works
139
-
>
140
-
> 
141
-
142
137
### MSAL.NET
143
138
144
139
Microsoft Authentication Library (MSAL, in the [Microsoft.Identity.Client](https://www.nuget.org/packages/Microsoft.Identity.Client) package) is the library that's used to sign in users and request tokens for accessing an API protected by the Microsoft identity platform. This quickstart requests tokens by using the application's own identity instead of delegated permissions. The authentication flow in this case is known as a [client credentials OAuth flow](../../v2-oauth2-client-creds-grant-flow.md). For more information on how to use MSAL.NET with a client credentials flow, see [this article](https://aka.ms/msal-net-client-credentials).
0 commit comments