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/active-directory/develop/quickstart-v2-java-webapp.md
+61-9Lines changed: 61 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,27 +32,27 @@ To run this sample you will need:
32
32
>
33
33
> ### Option 1: Register and auto configure your app and then download your code sample
34
34
>
35
-
> 1. Go to the [Azure portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps).
35
+
> 1. Go to the [Azure portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/JavaQuickstartPage/sourceType/docs) quickstart experience.
36
36
> 1. Enter a name for your application and select **Register**.
37
-
> 1. Follow the instructions to download and automatically configure your new application.
37
+
> 1. Follow the instructions in the portal's quickstart experience to download the automatically configured application code.
38
38
>
39
39
> ### Option 2: Register and manually configure your application and code sample
40
40
>
41
41
> #### Step 1: Register your application
42
42
>
43
-
> To register your application and manually add the app's registration information to your solution, follow these steps:
43
+
> To register your application and manually add the app's registration information to your application, follow these steps:
44
44
>
45
45
> 1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account, or a personal Microsoft account.
46
46
> 1. If your account gives you access to more than one tenant, select your account in the top right corner, and set your portal session to the desired Azure AD tenant.
47
47
>
48
-
> 1. Navigate to the Microsoft identity platform for developers [App registrations](/azure/active-directory/develop/) page.
48
+
> 1. Navigate to the Microsoft identity platform for developers [App registrations](https://go.microsoft.com/fwlink/?linkid=2083908) page.
49
49
> 1. Select **New registration**.
50
50
> 1. When the **Register an application** page appears, enter your application's registration information:
51
51
> - In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `java-webapp`.
52
-
> -Leave **Redirect URI** blank for now, and select**Register**.
52
+
> -Select**Register**.
53
53
> 1. On the **Overview** page, find the **Application (client) ID** and the **Directory (tenant) ID** values of the application. Copy these values for later.
54
54
> 1. Select the **Authentication** from the menu, and then add the following information:
55
-
> -In **Redirect URIs**, add `https://localhost:8080/msal4jsample/secure/aad` and `https://localhost:8080/msal4jsample/graph/me`.
55
+
> -Add the **Web** platform configuration. Add these `https://localhost:8080/msal4jsample/secure/aad` and `https://localhost:8080/msal4jsample/graph/me` as **Redirect URIs**..
56
56
> - Select **Save**.
57
57
> 1. Select the **Certificates & secrets** from the menu and in the **Client secrets** section, click on **New client secret**:
58
58
>
@@ -80,7 +80,7 @@ To run this sample you will need:
80
80
81
81
> [!div class="sxs-lookup" renderon="portal"]
82
82
> Download the project and extract the zip file to a local folder closer to the root folder - for example, **C:\Azure-Samples**
83
-
>
83
+
>
84
84
> To use https with localhost, fill in the server.ssl.key properties. To generate a self-signed certificate, use the keytool utility (included in JRE).
85
85
>
86
86
> ```
@@ -93,7 +93,7 @@ To run this sample you will need:
93
93
> server.ssl.key-alias=testCert
94
94
> ```
95
95
> Put the generated keystore file in the "resources" folder.
> [Download the code sample](https://github.com/Azure-Samples/ms-identity-java-webapp/archive/master.zip)
99
99
@@ -153,8 +153,56 @@ If you are running the web application from an IDE, click on run, then navigate
153
153
- *Sign Out*: Signs the current user out of the application and redirects them to the home page.
154
154
- *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.
155
155
156
+
##### Running from Tomcat
157
+
158
+
If you would like to deploy the web sample to Tomcat, you will need to make a couple of changes to the source code.
159
+
160
+
1. Open ms-identity-java-webapp/pom.xml
161
+
- Under `<name>msal-web-sample</name>` add `<packaging>war</packaging>`
3. Open a command prompt, go to the root folder of the project, and run `mvn package`
199
+
- This will generate a `msal-web-sample-0.1.0.war` file in your /targets directory.
200
+
- Rename this file to `ROOT.war`
201
+
- Deploy this war file using Tomcat or any other J2EE container solution.
202
+
- To deploy on Tomcat container, copy the .war file to the webapps folder under your Tomcat installation and then start the Tomcat server.
203
+
204
+
This WAR will automatically be hosted at https://localhost:8080/.
156
205
157
-
158
206
> [!IMPORTANT]
159
207
> This quickstart application uses a client secret to identify itself as confidential client. Because the client secret is added as a plain-text to your project files, for security reasons it is recommended that you use a certificate instead of a client secret before considering the application as production application. For more information on how to use a certificate, see [Certificate credentials for application authentication](https://docs.microsoft.com/azure/active-directory/develop/active-directory-certificate-credentials).
160
208
@@ -169,6 +217,8 @@ MSAL for Java (MSAL4J) is the Java library used to sign in users and request tok
169
217
170
218
Add MSAL4J to your application by using Maven or Gradle to manage your dependencies by making the following changes to the application's pom.xml (Maven) or build.gradle (Gradle) file.
171
219
220
+
In pom.xml:
221
+
172
222
```XML
173
223
<dependency>
174
224
<groupId>com.microsoft.azure</groupId>
@@ -177,6 +227,8 @@ Add MSAL4J to your application by using Maven or Gradle to manage your dependenc
Copy file name to clipboardExpand all lines: articles/active-directory/develop/quickstart-v2-python-webapp.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ ms.topic: quickstart
11
11
ms.workload: identity
12
12
ms.date: 09/25/2019
13
13
ms.author: abpati
14
-
ms.custom: aaddev
14
+
ms.custom: aaddev
15
15
---
16
16
17
17
# Quickstart: Add sign-in with Microsoft to a Python web app
@@ -38,8 +38,7 @@ To run this sample, you will need:
38
38
>
39
39
> ### Option 1: Register and auto configure your app and then download your code sample
40
40
>
41
-
> 1. Go to the [Azure portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps).
42
-
> 1. Select **New registration**.
41
+
> 1. Go to the [Azure portal - App registrations](https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/PythonQuickstartPage/sourceType/docs).
43
42
> 1. Enter a name for your application and select **Register**.
44
43
> 1. Follow the instructions to download and automatically configure your new application.
45
44
>
@@ -56,8 +55,11 @@ To run this sample, you will need:
56
55
> 1. When the **Register an application** page appears, enter your application's registration information:
57
56
> - In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `python-webapp`.
58
57
> - Under **Supported account types**, select **Accounts in any organizational directory and personal Microsoft accounts**.
59
-
> - Under the **Redirect URI** section, in the drop-down list, select the **Web** platform, and then set the value to `http://localhost:5000/getAToken`.
60
-
> - Select **Register**. On the app **Overview** page, note the **Application (client) ID** value for later use.
58
+
> - Select **Register**.
59
+
> - On the app **Overview** page, note the **Application (client) ID** value for later use.
60
+
> 1. Select the **Authentication** from the menu, and then add the following information:
61
+
> - Add the **Web** platform configuration. Add `http://localhost:5000/getAToken` as **Redirect URIs**.
62
+
> - Select **Save**.
61
63
> 1. On the left hand menu, choose **Certificates & secrets** and click on **New client secret** in the **Client Secrets** section:
62
64
>
63
65
> - Type a key description (of instance app secret).
@@ -102,11 +104,11 @@ To run this sample, you will need:
102
104
103
105
> [!div renderon="docs"]
104
106
> #### Step 3: Configure the Application
105
-
>
107
+
>
106
108
> 1. Extract the zip file to a local folder closer to the root folder - for example, **C:\Azure-Samples**
107
109
> 1. If you use an integrated development environment, open the sample in your favorite IDE (optional).
108
110
> 1. Open the **app_config.py** file, which can be found in the root folder and replace with the following code snippet:
0 commit comments