Skip to content

Commit

Permalink
Merge pull request #1291 from AzureAD/kreedula/merge_to_master
Browse files Browse the repository at this point in the history
Merge release 1.15.0 to master
  • Loading branch information
kreedula authored Aug 13, 2018
2 parents df8dcd9 + fde80af commit 6e68c02
Show file tree
Hide file tree
Showing 390 changed files with 39,336 additions and 2,492 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "common"]
path = common
url = https://github.com/AzureAD/microsoft-authentication-library-common-for-android.git
16 changes: 9 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

language: android

jdk:
jdk:
- oraclejdk8

# Don't use the Travis Container-Based Infrastructure
Expand All @@ -15,13 +15,15 @@ android:
- tools
- platform-tools
- tools
- build-tools-25.0.3
- android-25
- android-21
- build-tools-27.0.3
- android-27
- extra
- extra-android-m2repository
- extra-google-m2repository
- addon-google_apis-google-21
## Emulator config ##
# The SDK version used for the emulator
- android-21
#system images
- sys-img-armeabi-v7a-android-21

Expand All @@ -30,8 +32,8 @@ env:
# This is to guaratee a clean gradle log
- TERM=dumb
matrix:
- ANDROID_SDKS=android-25 ANDROID_TARGET=android-25
- ANDROID_SDKS=android-27 ANDROID_TARGET=android-27

before_install:
- chmod +x gradlew

Expand All @@ -53,4 +55,4 @@ before_script:

script:
- cd $PWD
- ./gradlew clean build connectedAndroidTest -PdisablePreDex
- ./gradlew clean adal:assembleLocal adal:connectedLocalDebugAndroidTest -PdisablePreDex
90 changes: 48 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Microsoft Azure Active Directory Authentication Library (ADAL) for Android

===========
ADAL for Android gives you the ability to add support for Work Accounts to your application. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two-factor authentication support. Best of all, it’s FOSS (Free and Open Source Software) so that you can participate in the development process as we build these libraries.

The ADAL SDK for Android gives you the ability to add support for Work Accounts to your application with just a few lines of additional code. This SDK gives your application the full functionality of Microsoft Azure AD, including industry standard protocol support for OAuth2, Web API integration with user level consent, and two-factor authentication support. Best of all, it’s FOSS (Free and Open Source Software) so that you can participate in the development process as we build these libraries.
A Work Account is an identity you use to get work done from your organization or school. Anywhere you need to get access to your work life you'll use a Work Account. The Work Account can be tied to an Active Directory server running in your datacenter or live completely in the cloud like when you use Office 365. A Work Account will be how your users know that they are accessing their important documents and data backed my Microsoft security.

A Work Account is an identity you use to get work done at your business or on a college campus. Anywhere you need to get access to your work life you'll use a Work Account. The Work Account can be tied to an Active Directory server running in your datacenter or live completely in the cloud like when you use Office365. A Work Account will be how your users know that they are accessing their important documents and data backed my Microsoft security.

## ADAL for Android 1.14.1 Released!
## ADAL for Android 1.15.0 Released!

## Build status

Expand All @@ -19,33 +17,32 @@ Note: A corpnet account is required to view the VSTS build.

## Versions

Current version - 1.14.1
Current version - 1.15.0

Minimum recommended version - 1.1.16
You can find the changes for each version in the [change log](https://github.com/AzureAD/azure-activedirectory-library-for-android/blob/master/changelog.txt).

You can find version-to-version differences in the [change log](https://github.com/AzureAD/azure-activedirectory-library-for-android/blob/master/changelog.txt).

## Features

* Industry standard Oauth2 protocol support.
* IdToken exposure for full access to the token contents.
* Multi resource refresh token allows for apps registered together to access different APIs without prompting the user.
* Id Token exposure for full access to the token contents.
* Multi-resource refresh token allows for apps registered together to access different APIs without prompting the user.
* Cache with Encryption for easily accessing existing tokens and session state with assurance it wasn't tampered with.
* Support for the Microsoft Azure AD Authenticator plug-in for Android, which will be released soon!
* Dialog and Fragment support

## Samples and Documentation

[We provide a full suite of sample applications and documentation on GitHub](https://github.com/AzureADSamples) to help you get started with learning the Azure Identity system. This includes tutorials for native clients such as Windows, Windows Phone, iOS, OSX, Android, and Linux. We also provide full walkthroughs for authentication flows such as OAuth2, OpenID Connect, Graph API, and other awesome features.
[We provide a full suite of sample applications and documentation on GitHub](https://github.com/azure-samples?utf8=%E2%9C%93&q=active+directory&type=&language=) to help you get started with learning the Azure Identity system. This includes tutorials for native clients such as Windows, Windows Phone, iOS, OSX, Android, and Linux. We also provide full walkthroughs for auth flows, the Microsoft Graph API, other Microsoft APIs, and other Azure AD features.

Visit your Azure Identity samples for Android here: [https://github.com/AzureADSamples/NativeClient-Android](https://github.com/AzureADSamples/NativeClient-Android)
Checkout the [ADAL for Android sample app for help getting started](https://github.com/Azure-Samples/active-directory-android).

Xamarin related info is here:
[https://github.com/AzureADSamples/NativeClient-Xamarin-Android](https://github.com/AzureADSamples/NativeClient-Xamarin-Android)
Looking for [Xamarin](https://github.com/AzureADSamples/NativeClient-Xamarin-Android)?

## Community Help and Support

We leverage [Stack Overflow](http://stackoverflow.com/) to work with the community on supporting Azure Active Directory and its SDKs, including this one! We highly recommend you ask your questions on Stack Overflow (we're all on there!) Also browse existing issues to see if someone has had your question before.

We recommend you use the "adal" tag so we can see it! Here is the latest Q&A on Stack Overflow for ADAL: [http://stackoverflow.com/questions/tagged/adal](http://stackoverflow.com/questions/tagged/adal)
We leverage [Stack Overflow](https://stackoverflow.com/questions/tagged/adal) to work with the community on supporting Azure Active Directory and its SDKs, including this one! We highly recommend you ask your questions on Stack Overflow (we're all on there!) Also browse existing issues to see if someone has had your question before.

## SSO and Conditional Access Support

Expand All @@ -59,12 +56,9 @@ If you find a security issue with our libraries or services please report it to

## Contributing

All code is licensed under the MIT license and we triage actively on GitHub. We enthusiastically welcome contributions and feedback. You can clone the repo and start contributing now. if you want to setup a maven environment please [check this](https://github.com/MSOpenTech/azure-activedirectory-library-for-android/wiki/Setting-up-maven-environment-for-Android)
More details [about contribution](https://github.com/AzureAD/azure-activedirectory-library-for-android/blob/master/contributing.md)
All code is licensed under the MIT license and we triage actively on GitHub. We enthusiastically welcome contributions and feedback.

## Versions

Please check the releases for updates.
For more details [about contribution](https://github.com/AzureAD/azure-activedirectory-library-for-android/blob/master/contributing.md)

## Quick Start

Expand All @@ -73,19 +67,21 @@ To build with Gradle,
* Clone this repo in to a directory of your choice
* Setup emulator with SDK 23
* Go to the root folder where you cloned this repo
* To run the sample app, connect the test device and run the command: ./gradlew :sample:installDebug
* You should see app 'hello' installed in the test device
* Enter test user credentials to try
* To run the sample app, connect the test device and run the command: `./gradlew :userappwithbroker:installDebug`
* You should see app 'Fancy ADAL Test App' installed on the test device
* Select an authority, [optionally] enter a login hint and/or query parameters, and click `Acquire Token` to enter credentials with AAD

> Note: The `authority`, `clientId`, `redirectUri` and `resource` of the test app can be found in [`Constants.java`](https://github.com/AzureAD/azure-activedirectory-library-for-android/blob/dev/userappwithbroker/src/main/java/com/microsoft/aad/adal/example/userappwithbroker/Constants.java). These values can be updated as necessary to test different tenants and configurations.
To build with Maven, you can use the pom.xml at top level

* Clone this repo in to a directory of your choice
* Follow the steps at [Prerequests section to setup your maven for android](https://github.com/MSOpenTech/azure-activedirectory-library-for-android/wiki/Setting-up-maven-environment-for-Android)
* Follow the steps at [Prerequisites section to setup your maven for android](https://github.com/AzureAD/azure-activedirectory-library-for-android/wiki/Maven)
* Setup emulator with SDK 19
* Go to the root folder where you cloned this repo
* Run the command: mvn clean install
* Change the directory to the Quick Start sample: cd samples\hello
* Run the command: mvn android:deploy android:run
* Run the command: `mvn clean install`
* Change the directory to the Quick Start sample: `cd userappwithbroker/`
* Run the command: `mvn android:deploy android:run`
* You should see app launching
* Enter test user credentials to try!

Expand All @@ -98,18 +94,14 @@ We've made it easy for you to have multiple options to use this library in your
* You can use the source code to import this library into Android Studio and link to your application.
* If using Android Studio, you can use *aar* package format and reference the binaries.

### Option 1: Source Zip

To download a copy of the source code, click "Download ZIP" on the right side of the page or click [here](https://github.com/AzureAD/azure-activedirectory-library-for-android/archive/v1.1.5.tar.gz).

### Option 2: Source via Git
### Option 1: Source via Git

To get the source code of the SDK via git:

git clone [email protected]:AzureAD/azure-activedirectory-library-for-android.git
git clone --recurse-submodules [email protected]:AzureAD/azure-activedirectory-library-for-android.git
cd ./azure-activedirectory-library-for-android/src

### Option 3: Binaries via Gradle
### Option 2: Binaries via Gradle

You can get the binaries from Maven central repo. AAR package can be included as follows in your project in AndroidStudio:

Expand All @@ -119,7 +111,7 @@ repositories {
}
dependencies {
// your dependencies here...
compile('com.microsoft.aad:adal:1.14.+') {
compile('com.microsoft.aad:adal:1.15.+') {
// if your app includes android support
// libraries or Gson in its dependencies
// exclude that groupId from ADAL's compile
Expand All @@ -132,20 +124,20 @@ dependencies {
}
```

### Option 4: aar via Maven
### Option 3: aar via Maven

If you are using the m2e plugin in Eclipse, you can specify the dependency in your pom.xml file:

```xml
<dependency>
<groupId>com.microsoft.aad</groupId>
<artifactId>adal</artifactId>
<version>1.14.1</version>
<version>1.15.0</version>
<type>aar</type>
</dependency>
```

### Option 5: jar package inside libs folder
### Option 4: jar package inside libs folder

You can get the jar file from maven the repo and drop into the *libs* folder in your project. You need to copy the required resources to your project as well since the jar packages don't include them.

Expand All @@ -162,7 +154,7 @@ You can get the jar file from maven the repo and drop into the *libs* folder in

1. Follow the Prerequisites

2. Add a reference to your project and specify it as an Android library. If you are uncertain how to do this, click here for more information: http://developer.android.com/tools/projects/projects-eclipse.html
2. Add a reference to your project and specify it as an Android library. If you are uncertain how to do this, [click here](http://developer.android.com/tools/projects/projects-eclipse.html) for more information.

3. Add the project dependency for debugging in to your project settings

Expand Down Expand Up @@ -316,11 +308,12 @@ In order to acquire token via broker, the following requirements have to be met
* Starting version 1.1.14, developer has to explicitly specify set to use broker via:
`AuthenticationSettings.INSTANCE.setUseBroker(true);`
* Developer needs to register special redirectUri for broker usage. RedirectUri is in the format of msauth://packagename/Base64UrlencodedSignature. You can get your redirecturi for your app using the script `brokerRedirectPrint.ps1` on Windows or `brokerRedirectPrint.sh` on Linux or Mac. You can also use API call mContext.getBrokerRedirectUri. Signature is related to your signing certificates.
* If target version is lower than 23, calling app has to have the following permissions declared in manifest(http://developer.android.com/reference/android/accounts/AccountManager.html):
* If target version is lower than 23, calling app has to have the following permissions declared in [the manifest](http://developer.android.com/reference/android/accounts/AccountManager.html):
* `GET_ACCOUNTS`
* `USE_CREDENTIALS`
* `MANAGE_ACCOUNTS`
* If target version is 23 or higher, `USE_CREDENTIALS` and `MANAGE_ACCOUNTS` are deprecated. But `GET_ACCOUNTS` is under protection level "dangerous", calling app is responsible for requesting the run-time permission; see [Runtime permission request for API 23](http://developer.android.com/training/permissions/requesting.html).
* If you get an exception like "Broker related permissions are missing for GET_ACCOUNTS" with error code "DEVELOPER_BROKER_PERMISSIONS_MISSING" when acquiring token, it means you're using a very old version of ADAL(prior to V1.12.0) or broker app(Microsoft Authenticator or Intune Company Portal), please upgrade to the latest version of ADAL and broker app.
* There must be an account existed and registered via one of the two broker apps.

AuthenticationContext provides API method to get the broker user.
Expand Down Expand Up @@ -383,6 +376,19 @@ Future<AuthenticationResult> result = mContext.acquireTokenSilent(resource, clie

You can also make sync call with this method. You can set null to callback or use acquireTokenSilentSync.

### ProGuard

If you are using ProGuard, we suggest disabling shrinking and obfuscation of ADAL classes so that our development team may assist you should issues arise. Additionally, portions of our unit and automation test code rely heavily on reflection and may not execute predictably across different versions of ProGuard.

To disable obfuscation of ADAL classes:

```
-keep class com.microsoft.aad.adal.** {
*;
}

```

### Diagnostics

The following are the primary sources of information for diagnosing issues:
Expand Down Expand Up @@ -512,7 +518,7 @@ Your application should overwrite them if localized strings are desired.

### NTLM dialog

Adal version 1.1.0 supports NTLM dialog that is processed through onReceivedHttpAuthRequest event from WebViewClient. Dialog layout and strings can be customized.
ADAL version 1.1.0 supports NTLM dialog that is processed through onReceivedHttpAuthRequest event from WebViewClient. Dialog layout and strings can be customized.

## License

Expand Down
Loading

0 comments on commit 6e68c02

Please sign in to comment.