Skip to content

Commit 1d70834

Browse files
authored
Merge pull request #93003 from navyasric/pythonqs-update
Add note and minor edits
2 parents 95123be + a212241 commit 1d70834

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,19 +100,20 @@ To run this sample you will need:
100100
>
101101
> - `Enter_the_Application_Id_here` - is the Application Id for the application you registered.
102102
> - `Enter_the_Client_Secret_Here` - is the **Client Secret** you created in **Certificates & Secrets** for the application you registered.
103+
> - `Enter_the_Tenant_Name_Here` - is the **Directory (tenant) ID** value of the application you registered.
103104
104105
#### Step 4: Run the code sample
105106
1. Run the code sample, and open a browser and navigate to *http://localhost:8080*.
106107
1. The front page contains a **sign-in** button. Click on the **sign-in** button to redirect to Azure Active Directory. The user will be prompted for their credentials.
107-
1. After successfully authenticating on Azure Active Directory, they will be redirected to *http://localhost:8080/msal4jsamples/secure/aad*. They are officially signed in to the application, and the page should show information for the signed in account. It will also contain buttons for:
108+
1. After successfully authenticating on Azure Active Directory, they will be redirected to *http://localhost:8080/msal4jsamples/secure/aad*. They are officially signed in to the application, and the page should show information for the signed in account. It will also contain buttons for:
108109
- *Sign Out*: Will sign out the current user from the application, and redirect them the home page.
109110
- *Show Users*: Will acquire a token for the Microsoft Graph, then call the Microsoft Graph with the token attached to the request to get all of the users in the tenant.
110111

111112
## More information
112113

113114
### Getting MSAL
114-
MSAL4J is the library used to sign in users and request tokens used to access an API protected by the Microsoft identity Platform.
115-
You can add MSAL4J to your application by using Maven or Gradle to manage your dependencies by making the following changes to the pom.xml or build.gradle file in your application.
115+
MSAL4J is the library used to sign in users and request tokens used to access an API protected by the Microsoft identity Platform.
116+
You can add MSAL4J to your application by using Maven or Gradle to manage your dependencies by making the following changes to the pom.xml or build.gradle file in your application.
116117

117118
```XML
118119
<dependency>

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

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,15 +97,17 @@ To run this sample, you will need:
9797
1. Open the **app_config.py** file, which can be found in the root folder and replace with the following code snippet:
9898

9999
```python
100-
CLIENT_SECRET = "Enter_the_Client_Secret_Here"
101100
CLIENT_ID = "Enter_the_Application_Id_here"
101+
CLIENT_SECRET = "Enter_the_Client_Secret_Here"
102+
AUTHORITY = "https://login.microsoftonline.com/Enter_the_Tenant_Name_Here"
102103
```
103104

104105
> [!div renderon="docs"]
105106
> Where:
106107
>
107108
> - `Enter_the_Application_Id_here` - is the Application Id for the application you registered.
108109
> - `Enter_the_Client_Secret_Here` - is the **Client Secret** you created in **Certificates & Secrets** for the application you registered.
110+
> - `Enter_the_Tenant_Name_Here` - is the **Directory (tenant) ID** value of the application you registered.
109111
110112
#### Step 4: Run the code sample
111113

@@ -120,6 +122,25 @@ CLIENT_ID = "Enter_the_Application_Id_here"
120122
```Shell
121123
python app.py
122124
```
125+
> [!IMPORTANT]
126+
> 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 [these instructions](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-certificate-credentials).
127+
128+
## More information
129+
130+
### Getting MSAL
131+
MSAL is the library used to sign in users and request tokens used to access an API protected by the Microsoft identity Platform.
132+
You can add MSAL Python to your application using Pip.
133+
134+
```Shell
135+
pip install msal
136+
```
137+
138+
### MSAL initialization
139+
You can add the reference to MSAL Python by adding the following code to the top of the file where you will be using MSAL:
140+
141+
```Python
142+
import msal
143+
```
123144

124145
## Next steps
125146

0 commit comments

Comments
 (0)