Skip to content

Commit 29f2291

Browse files
author
Ramya
committed
minor changes to README
1 parent da1465a commit 29f2291

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

README.md

+34-35
Original file line numberDiff line numberDiff line change
@@ -70,44 +70,44 @@ As a first step you'll need to:
7070
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account or a personal Microsoft account.
7171
1. If your account is present in more than one Azure AD tenant, select your profile at the top right corner in the menu on top of the page, and then **switch directory**.
7272
Change your portal session to the desired Azure AD tenant.
73-
1. In the portal menu click on **All services** and choose **Azure Active Directory**.
73+
1. In the portal menu, click on **All services** and choose **Azure Active Directory**.
7474

7575
> In the next steps, you might need the tenant name (or directory name) or the tenant ID (or directory ID). These are presented in the **Properties** of the Azure Active Directory window respectively as *Name* and *Directory ID*
7676
77-
#### Register the Web Api app (java-webapi)
77+
#### Register the Web Api app (Java-webapi)
7878

7979
1. Navigate to the Microsoft identity platform for developers [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) page.
80-
1. Click **New registration** on top.
80+
1. Click **New registration**.
8181
1. In the **Register an application page** that appears, enter your application's registration information:
82-
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `java-webapi`.
82+
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `Java-webapi`.
8383
- Change **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
84-
1. Click on the **Register** button in bottom to create the application.
85-
1. In the app's registration screen, find the **Application (client) ID** and **Directory (tenant) ID** value and record it for use later. You'll need it to configure the configuration file(s) later in your code.
86-
1. Click the **Save** button on top to save the changes.
87-
1. In the app's registration screen, click on the **Certificates & secrets** blade to open the page where we can generate secrets and upload certificates.
84+
1. Click on the **Register** button to create the application.
85+
1. In the app's registration **Overview** page, find the **Application (client) ID** and **Directory (tenant) ID** value and record it for use later. You'll need it to configure the configuration file(s) later in your code.
86+
1. Click the **Save** button to save the changes.
87+
1. In the Application menu blade, click on the **Certificates & secrets** to open the page where we can generate secrets and upload certificates.
8888
1. In the **Client secrets** section, click on **New client secret**:
8989
- Type a key description (for instance `app secret`),
9090
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security concerns.
9191
- The generated key value will be displayed when you click the **Add** button. Copy the generated value for use in the steps later.
9292
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
93-
1. In the app's registration screen, click on the **API permissions** blade to open the page where we add access to the Apis that your application needs.
93+
1. In the Application menu blade, click on the **API permissions** to open the page where we add access to the Apis that your application needs.
9494
- Click the **Add a permission** button and then,
9595
- Ensure that the **Microsoft APIs** tab is selected.
9696
- In the *Commonly used Microsoft APIs* section, click on **Microsoft Graph**
9797
- In the **Delegated permissions** section, select the **User.Read** in the list. Use the search box if necessary.
9898
- Click on the **Add permissions** button in the bottom.
99-
1. In the app's registration screen, click on the **Expose an API** blade to open the page where declare the parameters to expose this app as an Api for which client applications can obtain [access tokens](https://docs.microsoft.com/azure/active-directory/develop/access-tokens) for.
99+
1. In the Application menu blade, click on the **Expose an API** to open the page where declare the parameters to expose this app as an Api for which client applications can obtain [access tokens](https://docs.microsoft.com/azure/active-directory/develop/access-tokens) for.
100100
The first thing that we need to do is to declare the unique [resource](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow) URI that the clients will be using to obtain access tokens for this Api. To declare an resource URI, follow the following steps:
101-
- Click `Set` next to the **Application ID URI** to generate a URI thats unique for this app.
101+
- Click `Set` next to the **Application ID URI** to generate a URI that is unique for this app.
102102
- For this sample, accept the proposed Application ID URI (api://{clientId}) by selecting **Save**.
103103
1. All Apis have to publish a minimum of one [scope](https://docs.microsoft.com/azure/active-directory/develop/v2-oauth2-auth-code-flow#request-an-authorization-code) for the client's to obtain an access token successfully. To publish a scope, follow the following steps:
104104
- Select **Add a scope** button open the **Add a scope** screen and Enter the values as indicated below:
105105
- For **Scope name**, use `access_as_user`.
106106
- Select **Admins and users** options for **Who can consent?**
107-
- For **Admin consent display name** type `Access java-webapi`
108-
- For **Admin consent description** type `Allows the app to access java-webapi as the signed-in user.`
109-
- For **User consent display name** type `Access java-webapi`
110-
- For **User consent description** type `Allow the application to access java-webapi on your behalf.`
107+
- For **Admin consent display name** type `Access Java-webapi`
108+
- For **Admin consent description** type `Allows the app to access Java-webapi as the signed-in user.`
109+
- For **User consent display name** type `Access Java-webapi`
110+
- For **User consent description** type `Allow the application to access Java-webapi on your behalf.`
111111
- Keep **State** as **Enabled**
112112
- Click on the **Add scope** button on the bottom to save this scope.
113113

@@ -119,33 +119,32 @@ Open `application.properties` in the src/main/resources folder. Fill in with you
119119
- *Enter_the_Application_Id_here* with the **Application (client) ID**.
120120
- *Enter_the_Client_Secret_Here* with the **key value** noted earlier.
121121

122-
#### Register the client web app (java_webapp)
122+
#### Register the client web app (Java_webapp)
123123

124124
1. Navigate to the Microsoft identity platform for developers [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) page.
125-
1. Click **New registration** on top.
125+
1. Click **New registration**.
126126
1. In the **Register an application page** that appears, enter your application's registration information:
127127
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `java_webapp`.
128128
- Change **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
129129
> Note that there are more than one redirect URIs used in this sample. You'll need to add them from the **Authentication** tab later after the app has been created successfully.
130-
1. Click on the **Register** button in bottom to create the application.
131-
1. In the app's registration screen, find the **Application (client) ID** value and record it for later. You'll need it to configure the configuration file(s) later in your code.
132-
1. In the app's registration screen, click on the **Authentication** blade.
130+
1. Click on the **Register** button to create the application.
131+
1. In the app's registration **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the configuration file(s) later in your code.
132+
1. In the Application menu blade, click on the **Authentication**.
133133
- In the Redirect URIs section, select **Web** in the drop down and enter the following redirect URIs.
134134
- `http://localhost:8080/msal4jsample/secure/aad`
135135
- `http://localhost:8080/msal4jsample/graph/me`
136-
- In the **Advanced settings** section, set **Logout URL** to `https://localhost:8080/msal4jsample/sign-out`.
137136

138-
1. Click the **Save** button on top to save the changes.
139-
1. In the app's registration screen, click on the **Certificates & secrets** blade to open the page where we can generate secrets and upload certificates.
137+
1. Click the **Save** button to save the changes.
138+
1. In the Application menu blade, click on the **Certificates & secrets** to open the page where we can generate secrets and upload certificates.
140139
1. In the **Client secrets** section, click on **New client secret**:
141140
- Type a key description (for instance `app secret`),
142141
- Select one of the available key durations (**In 1 year**, **In 2 years**, or **Never Expires**) as per your security concerns.
143142
- The generated key value will be displayed when you click the **Add** button. Copy the generated value for use in the steps later.
144143
- You'll need this key later in your code's configuration files. This key value will not be displayed again, and is not retrievable by any other means, so make sure to note it from the Azure portal before navigating to any other screen or blade.
145-
1. In the app's registration screen, click on the **API permissions** blade to open the page where we add access to the Apis that your application needs.
144+
1. In the Application menu blade, click on the **API permissions** to open the page where we add access to the Apis that your application needs.
146145
- Click the **Add a permission** button and then,
147146
- Ensure that the **My APIs** tab is selected.
148-
- In the list of APIs, select the API `java-webapi`.
147+
- In the list of APIs, select the API `Java-webapi`.
149148
- In the **Delegated permissions** section, select the **access_as_user** in the list. Use the search box if necessary.
150149
- Click on the **Add permissions** button in the bottom.
151150

@@ -157,18 +156,18 @@ Open `application.properties` in the src/main/resources folder. Fill in with you
157156
- Replace *Enter_the_Client_Secret_Here* with the **key value** noted earlier.
158157
- Replace *OboApi* with the API exposed in the `Web Api app` **(api://{clientId})**.
159158

160-
#### Configure known client applications for service (java-webapi)
159+
#### Configure known client applications for service (Java-webapi)
161160

162-
For a middle tier web API (`java-webapi`) to be able to call a downstream web API, the middle tier app needs to be granted the required permissions as well.
161+
For a middle tier web API (`Java-webapi`) to be able to call a downstream web API, the middle tier app needs to be granted the required permissions as well.
163162
However, since the middle tier cannot interact with the signed-in user, it needs to be explicitly bound to the client app in its Azure AD registration.
164163
This binding merges the permissions required by both the client and the middle tier WebApi and and presents it to the end user in a single consent dialog. The user than then consent to this combined set of permissions.
165164

166-
To achieve this, you need to add the "Client ID" of the client app, in the manifest of the web API in the `knownClientApplications` property. Here's how:
165+
To achieve this, you need to add the "Client ID" of the client app, in the manifest of the web API in the **knownClientApplications** property. Here's how:
167166

168-
In the [Azure portal](https://portal.azure.com), navigate to your `java-webapi` app registration:
167+
In the [Azure portal](https://portal.azure.com), navigate to your `Java-webapi` app registration:
169168

170169
- In the Application menu blade, select **Manifest**.
171-
- Find the attribute **knownClientApplications** and add your client application's(`java-webapp`) **Application (client) Id** as its element.
170+
- Find the attribute **knownClientApplications** and add your client application's(`Java-webapp`) **Application (client) Id** as its element.
172171
- Click **Save**.
173172

174173
### Step 4: Run the applications
@@ -241,7 +240,7 @@ If you would like to deploy the sample to Tomcat, you will need to make a couple
241240
- This will generate a `msal-web-sample-0.1.0.war` file in your /targets directory.
242241
- Rename this file to `ROOT.war`
243242
- Deploy this war file using Tomcat or any other J2EE container solution.
244-
- To deploy on Tomcat container, copy the .war file to the webapps folder under your Tomcat installation and then start the Tomcat server.
243+
- To deploy on Tomcat container, copy the .war file to the webapp's folder under your Tomcat installation and then start the Tomcat server.
245244
- Repeat these steps for the `msal-obo-sample` also.
246245
247246
This WAR will automatically be hosted at `http:<yourserverhost>:<yourserverport>/`
@@ -273,7 +272,7 @@ There are many key points in this sample to make the On-Behalf-Of-(OBO) flow wor
273272

274273
A code snippet showing how to obtain auth result by silent flow.
275274

276-
```java
275+
```Java
277276

278277
private ConfidentialClientApplication createClientApplication() throws MalformedURLException {
279278
return ConfidentialClientApplication.builder(clientId, ClientCredentialFactory.create(clientSecret))
@@ -307,7 +306,7 @@ There are many key points in this sample to make the On-Behalf-Of-(OBO) flow wor
307306

308307
Contains the api(graphMeApi) to trigger the obo flow. The graphMeApi method gets the obo access token using **MsalAuthHelper**. The `callMicrosoftGraphEndPoint` method calls the Microsoft graph API using obo token.
309308

310-
```java
309+
```Java
311310
String oboAccessToken = msalAuthHelper.getOboToken("https://graph.microsoft.com/.default");
312311

313312
return callMicrosoftGraphMeEndpoint(oboAccessToken);
@@ -325,7 +324,7 @@ There are many key points in this sample to make the On-Behalf-Of-(OBO) flow wor
325324

326325
Token Validation of the caller happens in this class, where the access token presented by the client app is validated and another access token is obtained using the on-behalf-of flow
327326

328-
```java
327+
```Java
329328
http
330329
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
331330
.and()
@@ -340,7 +339,7 @@ There are many key points in this sample to make the On-Behalf-Of-(OBO) flow wor
340339

341340
A code snippet showing how to obtain obo token
342341

343-
```java
342+
```Java
344343
OnBehalfOfParameters parameters =
345344
OnBehalfOfParameters.builder(Collections.singleton(scope),
346345
new UserAssertion(authToken))

0 commit comments

Comments
 (0)