Skip to content

Commit c6efeff

Browse files
authored
Merge pull request #157219 from hamiltonha/patch-30
update quickstart per feedback
2 parents dfb961b + 8218c12 commit c6efeff

File tree

2 files changed

+48
-12
lines changed

2 files changed

+48
-12
lines changed

articles/active-directory/develop/quickstart-v2-android.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,12 +109,6 @@ We'll now look at these files in more detail and call out the MSAL-specific code
109109

110110
MSAL ([com.microsoft.identity.client](https://javadoc.io/doc/com.microsoft.identity.client/msal)) is the library used to sign in users and request tokens used to access an API protected by Microsoft identity platform. Gradle 3.0+ installs the library when you add the following to **Gradle Scripts** > **build.gradle (Module: app)** under **Dependencies**:
111111

112-
```gradle
113-
implementation 'com.microsoft.identity.client:msal:2.+'
114-
```
115-
116-
You can see this in the sample project in build.gradle (Module: app):
117-
118112
```java
119113
dependencies {
120114
...
@@ -125,6 +119,30 @@ dependencies {
125119

126120
This instructs Gradle to download and build MSAL from maven central.
127121

122+
You must also add references to maven to the **allprojects** > **repositories** portion of the **build.gradle (Module: app)** like so:
123+
124+
```java
125+
allprojects {
126+
repositories {
127+
mavenCentral()
128+
google()
129+
mavenLocal()
130+
maven {
131+
url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
132+
}
133+
maven {
134+
name "vsts-maven-adal-android"
135+
url "https://identitydivision.pkgs.visualstudio.com/_packaging/AndroidADAL/maven/v1"
136+
credentials {
137+
username System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") : project.findProperty("vstsUsername")
138+
password System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") : project.findProperty("vstsMavenAccessToken")
139+
}
140+
}
141+
jcenter()
142+
}
143+
}
144+
```
145+
128146
### MSAL imports
129147

130148
The imports that are relevant to the MSAL library are `com.microsoft.identity.client.*`. For example, you'll see `import com.microsoft.identity.client.PublicClientApplication;` which is the namespace for the `PublicClientApplication` class, which represents your public client application.

articles/active-directory/develop/tutorial-v2-android.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,18 +148,36 @@ If you do not already have an Android application, follow these steps to set up
148148

149149
### Add MSAL to your project
150150

151-
1. In the Android Studio project window, navigate to **app** > **src** > **build.gradle** and add the following:
151+
1. In the Android Studio project window, navigate to **app** > **build.gradle** and add the following:
152152

153153
```gradle
154-
repositories{
154+
apply plugin: 'com.android.application'
155+
156+
allprojects {
157+
repositories {
158+
mavenCentral()
159+
google()
160+
mavenLocal()
161+
maven {
162+
url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
163+
}
164+
maven {
165+
name "vsts-maven-adal-android"
166+
url "https://identitydivision.pkgs.visualstudio.com/_packaging/AndroidADAL/maven/v1"
167+
credentials {
168+
username System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") : project.findProperty("vstsUsername")
169+
password System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") : project.findProperty("vstsMavenAccessToken")
170+
}
171+
}
155172
jcenter()
173+
}
156174
}
157175
dependencies{
158-
implementation 'com.microsoft.identity.client:msal:2.+'
159-
implementation 'com.microsoft.graph:microsoft-graph:1.5.+'
160-
}
176+
implementation 'com.microsoft.identity.client:msal:2.+'
177+
implementation 'com.microsoft.graph:microsoft-graph:1.5.+'
178+
}
161179
packagingOptions{
162-
exclude("META-INF/jersey-module-version")
180+
exclude("META-INF/jersey-module-version")
163181
}
164182
```
165183
[More on the Microsoft Graph SDK](https://github.com/microsoftgraph/msgraph-sdk-java/)

0 commit comments

Comments
 (0)