Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Commit 65374b7

Browse files
authored
Merge pull request #18 from Azure-Samples/https-readme-update
https readme update
2 parents bce5fcf + b0cb081 commit 65374b7

File tree

2 files changed

+21
-12
lines changed

2 files changed

+21
-12
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -153,21 +153,27 @@ Open `application.properties` in the msal-web-sample/src/main/resources folder.
153153
- Replace *Enter_the_Client_Secret_Here* with the **key value** noted earlier.
154154
- Replace *OboApi* with the API exposed in the `Web Api app` **(api://{clientId})**.
155155

156-
If you want to use https with localhost, you must have a certificate.
157-
Use the `keytool` utility (included in JRE) if you want to generate self-signed certificate.
156+
#### HTTPS on localhost
158157

159-
```Bash
160-
keytool -genkeypair -alias testCert -keyalg RSA -storetype PKCS12 -keystore keystore.p12 -storepass password
161-
```
158+
If you are only testing locally, you may skip this step. If you deploy your app to Azure App Service (for production or for testing), https is handled by Azure and you may skip this step. Note that https is essential for providing critical security and data integrity to your applications, and http should not be used outside of testing scenarios. If you need to configure your application to handle https, complete the instructions in this section.
162159

163-
You may then put the following key-value pairs into your `application.properties` file.
160+
1. Use the `keytool` utility (included in JRE) if you want to generate self-signed certificate.
164161

165-
```ini
166-
server.ssl.key-store-type=PKCS12
167-
server.ssl.key-store=classpath:keystore.p12
168-
server.ssl.key-store-password=password
169-
server.ssl.key-alias=testCert
170-
```
162+
```Bash
163+
keytool -genkeypair -alias testCert -keyalg RSA -storetype PKCS12 -keystore keystore.p12 -storepass password
164+
```
165+
166+
2. Put the following key-value pairs into your [application.properties](msal-web-sample/src/main/resources/application.properties) file.
167+
168+
```ini
169+
server.ssl.key-store-type=PKCS12
170+
server.ssl.key-store=classpath:keystore.p12
171+
server.ssl.key-store-password=password
172+
server.ssl.key-alias=testCert
173+
```
174+
175+
3. Change both occurrences of `8080` to `8443` in the msal-web-sample's [application.properties](msal-web-sample/src/main/resources/application.properties) file.
176+
4. Update your java_webapp Azure AD application registration redirects (e.g., `https://localhost:8443/msal4jsample/secure/aad` and `https://localhost:8443/msal4jsample/graph/me`) on the [Azure Portal](https://portal.azure.com).
171177
172178
#### Configure known client applications for service (Java-webapi)
173179
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
aad.authority=https://login.microsoftonline.com/common/
22
aad.clientId=Enter_the_Application_Id_Here
33
aad.secretKey=Enter_the_Client_Secret_Here
4+
5+
# change the port to 8443 if running HTTPS on localhost
46
aad.redirectUri=http://localhost:8080/msal4jsample/secure/aad
57
aad.oboApi=api://Enter_the_Obo_Api_Application_Id_Here/access_as_user
68
aad.webapp.defaultScope=api://Enter_the_Obo_Api_Application_Id_Here/.default
79

10+
# change the port to 8443 if running HTTPS on localhost
811
server.port=8080

0 commit comments

Comments
 (0)