Skip to content

Commit 1f94a63

Browse files
authored
https configuration for localhost
1 parent 5e46ec9 commit 1f94a63

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

articles/active-directory/develop/quickstart-v2-java-webapp.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ To run this sample you will need:
5757
> - Leave **Redirect URI** blank for now, and select **Register**.
5858
> 1. On the **Overview** page, find the **Application (client) ID** and the **Directory (tenant) ID** values of the application. Copy these values for later.
5959
> 1. Select the **Authentication** from the menu, and then add the following information:
60-
> - In **Redirect URIs**, add `http://localhost:8080/msal4jsample/secure/aad` and `http://localhost:8080/msal4jsample/graph/me`.
60+
> - In **Redirect URIs**, add `https://localhost:8080/msal4jsample/secure/aad` and `https://localhost:8080/msal4jsample/graph/me`.
6161
> - Select **Save**.
6262
> 1. Select the **Certificates & secrets** from the menu and in the **Client secrets** section, click on **New client secret**:
6363
>
@@ -71,7 +71,7 @@ To run this sample you will need:
7171
>
7272
> For the code sample for this quickstart to work, you need to:
7373
>
74-
> 1. Add reply URLs as `http://localhost:8080/msal4jsamples/secure/aad` and `http://localhost:8080/msal4jsamples/graph/me`.
74+
> 1. Add reply URLs as `https://localhost:8080/msal4jsamples/secure/aad` and `https://localhost:8080/msal4jsamples/graph/me`.
7575
> 1. Create a Client Secret.
7676
> > [!div renderon="portal" id="makechanges" class="nextstepaction"]
7777
> > [Make these changes for me]()
@@ -94,8 +94,8 @@ To run this sample you will need:
9494
aad.clientId=Enter_the_Application_Id_here
9595
aad.authority=https://login.microsoftonline.com/Enter_the_Tenant_Info_Here/
9696
aad.secretKey=Enter_the_Client_Secret_Here
97-
aad.redirectUriSignin=http://localhost:8080/msal4jsample/secure/aad
98-
aad.redirectUriGraph=http://localhost:8080/msal4jsample/graph/me
97+
aad.redirectUriSignin=https://localhost:8080/msal4jsample/secure/aad
98+
aad.redirectUriGraph=https://localhost:8080/msal4jsample/graph/me
9999
```
100100
101101
> [!div renderon="docs"]
@@ -105,6 +105,20 @@ To run this sample you will need:
105105
> - `Enter_the_Client_Secret_Here` - is the **Client Secret** you created in **Certificates & Secrets** for the application you registered.
106106
> - `Enter_the_Tenant_Info_Here` - is the **Directory (tenant) ID** value of the application you registered.
107107
108+
4. In order to use https with localhost fill in server.ssl.key properties.
109+
Use keytool utility (included in JRE) if you want to generate self-signed certificate.
110+
111+
```
112+
Example:
113+
keytool -genkeypair -alias testCert -keyalg RSA -storetype PKCS12 -keystore keystore.p12 -storepass password
114+
115+
server.ssl.key-store-type=PKCS12
116+
server.ssl.key-store=classpath:keystore.p12
117+
server.ssl.key-store-password=password
118+
server.ssl.key-alias=testCert
119+
```
120+
Put generated keystore file to "resources" folder.
121+
108122
#### Step 4: Run the code sample
109123
110124
To run the project, you can either:
@@ -113,11 +127,11 @@ Run it directly from your IDE by using the embedded spring boot server or packag
113127
114128
##### Running from IDE
115129
116-
If you are running the web application from an IDE, click on run, then navigate to the home page of the project. For this sample, the standard home page URL is http://localhost:8080
130+
If you are running the web application from an IDE, click on run, then navigate to the home page of the project. For this sample, the standard home page URL is https://localhost:8080
117131
118132
1. On the front page, select the **Login** button to redirect to Azure Active Directory and prompt the user for their credentials.
119133
120-
1. After the user is authenticated, they are redirected to *http://localhost:8080/msal4jsample/secure/aad*. They are now signed in, and the page will show information about the signed-in account. The sample UI has the following buttons:
134+
1. After the user is authenticated, they are redirected to *https://localhost:8080/msal4jsample/secure/aad*. They are now signed in, and the page will show information about the signed-in account. The sample UI has the following buttons:
121135
- *Sign Out*: Signs the current user out of the application and redirects them to the home page.
122136
- *Show User Info*: Acquires a token for Microsoft Graph and calls Microsoft Graph with a request containing the token, which returns basic information about the signed-in user.
123137

0 commit comments

Comments
 (0)