366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey# ForgeRock Authenticator for Android
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey## About
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThe ForgeRock Authenticator provides a secure method for users to access their accounts managed by ForgeRock's OpenAM.
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThis works in combination with OpenAM's "ForgeRock Authenticator (OATH)" and "ForgeRock Authenticator (Push)" authentication modules.
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThe supported version of the binary is available on the Play Store.
33edf88fc9f9a7f65986e9ac78453231d5645891Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey## Building the App
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey* Download the project's code (`git clone ...`)
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey* This app requires a google-services.json file in order to be built. The file should be placed in the app folder.
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyIf the file has not yet been generated, go to the [cloud messaging setup guide](https://developers.google.com/cloud-messaging/android/start)
366070e80541a5ff6ae229afd9185343162179a0Tom Rumseyand follow "Step 2. Get a configuration file".
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey* Open the project using Android Studio. The app can be built and loaded onto an emulator or phone using the 'app' run configuration.
ef28ad515cc0858ccbfba09e17a844052ed79356Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey## Running Unit Tests
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyIn order to run the tests, run the following command:`./gradlew generateCoverage`
ef28ad515cc0858ccbfba09e17a844052ed79356Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThis will run the unit tests and generate a coverage report.
ef28ad515cc0858ccbfba09e17a844052ed79356Tom Rumsey
ef28ad515cc0858ccbfba09e17a844052ed79356Tom RumseyThe unit test report is located at:
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey`{baseFolder}/app/build/reports/tests/debug/index.html`
ef28ad515cc0858ccbfba09e17a844052ed79356Tom Rumsey
ef28ad515cc0858ccbfba09e17a844052ed79356Tom RumseyThe coverage report is located at:
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey`{baseFolder}/app/build/reports/jacoco/generateCoverage/html/index.html`
ef28ad515cc0858ccbfba09e17a844052ed79356Tom Rumsey
ef28ad515cc0858ccbfba09e17a844052ed79356Tom RumseyNote that the coverage report will not be generated if there are any test failures.
ef28ad515cc0858ccbfba09e17a844052ed79356Tom Rumsey
ef28ad515cc0858ccbfba09e17a844052ed79356Tom RumseyThe target is to have a large coverage for non android classes (e.g. non ui and database classes)
76e306183bb8c3935c091a558690edc310edbd70Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey## Instrumentation Tests
76e306183bb8c3935c091a558690edc310edbd70Tom Rumsey
76e306183bb8c3935c091a558690edc310edbd70Tom RumseyTo run the instrumentation tests, first connect and unlock the test devices, or start emulators.
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThen, run: `./gradlew spoon`
76e306183bb8c3935c091a558690edc310edbd70Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThe instrumentation test report is located at:
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey`{baseFolder}/app/build/spoon/debug/index.html`
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey## Notes
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey* When debugging, be sure to disable code coverage, as it interferes with the debugger and prevents access to variables.
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyDo this by opening app.gradle, and updating the value of `testCoverageEnabled` to false.
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey* When adding, removing or updating 3rd party dependencies, be sure to update the
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey[Third Party README](THIRDPARTYREADME.txt).
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey* * *
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyThe contents of this file are subject to the terms of the Common Development and
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyDistribution License (the License). You may not use this file except in compliance with the
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyLicense.
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyYou can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
366070e80541a5ff6ae229afd9185343162179a0Tom Rumseyspecific language governing permission and limitations under the License.
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyWhen distributing Covered Software, include this CDDL Header Notice in each file and include
366070e80541a5ff6ae229afd9185343162179a0Tom Rumseythe License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyHeader, with the fields enclosed by brackets [] replaced by your own identifying
366070e80541a5ff6ae229afd9185343162179a0Tom Rumseyinformation: "Portions copyright [year] [name of copyright owner]".
366070e80541a5ff6ae229afd9185343162179a0Tom Rumsey
366070e80541a5ff6ae229afd9185343162179a0Tom RumseyCopyright 2016 ForgeRock AS.