Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions android/kotlin-journey/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
54 changes: 54 additions & 0 deletions android/kotlin-journey/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<p align="center">
<a href="https://github.com/ForgeRock/sdk-sample-apps">
<img src="https://www.pingidentity.com/content/dam/picr/nav/Ping-Logo-2.svg" alt="Ping Identity Logo">
</a>
<hr/>
</p>

# Journey app using Kotlin

Ping provides these Android samples to help demonstrate SDK functionality/implementation. They are provided "as is" and are not official products of Ping and are not officially supported.

This repository contains an example Android project written in Kotlin making use of the SDK. The sample supports the OOTB Journey Login flow.

# Introduction

This sample application demonstrates how to integrate the ForgeRock Android SDK into a basic application. The sample app includes examples of the following:

- OOTB Journey Login flow

- Displaying authenticated user status.

- Displaying authenticated token.

- Ability to logout existing user and restart the login flow.

- Built with modern Android components (Jetpack Compose, Kotlin).

## Requirements

- Android Studio: Latest version recommended
- Ping AIC
- Android API Level: 28 (Android 9.0) or higher

## Getting Started

To try out the Journey Android SDK sample, perform these steps:
1. Configure Ping Services
Ensure that you registered an OAuth 2.0 application for native mobile apps in AIC. More details in this [documentation](https://backstage.forgerock.com/docs/sdks/latest/sdks/serverconfiguration/pingone/create-oauth2-client.html).

2. Clone this repo:

```
git clone https://github.com/ForgeRock/sdk-sample-apps.git
```
3. Open the Android sample project(kotlin-journey) in [Android Studio](https://developer.android.com/studio).
4. Open the `EnvViewModel.kt` file within the project.
5. Locate the TODO and replace the placeholder strings in the Oidc module configuration with the values of your registered OAuth 2.0 application.
- You can add multiple configurations as shown with `testConfig` and `prodConfig` depending on you Oidc module configuration.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The app currently crashes upon launching if both testConfig and prodConfig are not set configured...

com.pingidentity.samples.journeyapp  E  FATAL EXCEPTION: main (Ask Gemini)
       Process: com.pingidentity.samples.journeyapp, PID: 3975
       java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
       	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
       	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
       Caused by: java.lang.reflect.InvocationTargetException
       	at java.lang.reflect.Method.invoke(Native Method)
       	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
       	... 1 more
       Caused by: java.net.MalformedURLException: no protocol: <Discovery Endpoint>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, this align with the DaVinci sample App.

I hope developer will look at the Readme before they try out the sample App.
I have added the following comment under the TODO

/*
 * TODO
 * This configuration allows you to provide 2 different environments: testConfig and prodConfig.
 * You must provide valid information for the sample app to work.
 * (If an invalid discoveryEndpoint format is provided, the app may crash)
 *
 * The sample app uses the clientId to differentiate the environment.
 * Use a different clientId for testing.
 */

6. Go to `journey\build.gradle.kts` and update the value of `appRedirectUriScheme` with the redirect URI schema from your OIDC configuration.
7. Connect an Android device or emulator.
8. On the **Run** menu, click **Run 'app'**.

## Additional Resources
Ping SDK Documentation: https://docs.pingidentity.com/sdks/latest/sdks/index.html
12 changes: 12 additions & 0 deletions android/kotlin-journey/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright (c) 2026 Ping Identity Corporation. All rights reserved.
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
alias(libs.plugins.androidApplication) apply false
alias(libs.plugins.kotlinAndroid) apply false
}
17 changes: 17 additions & 0 deletions android/kotlin-journey/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#
# Copyright (c) 2026 Ping Identity Corporation. All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#

#Gradle
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
org.gradle.caching=true

#Kotlin
kotlin.code.style=official

#Android
android.useAndroidX=true
android.nonTransitiveRClass=true
62 changes: 62 additions & 0 deletions android/kotlin-journey/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[versions]
activityCompose = "1.9.3"
agp = "8.12.2"
coreSplashscreen = "1.0.1"
datastore = "1.1.7"
ping = "2.0.0-beta1"
kotlin = "2.2.0"
compose = "1.7.4"
compose-material3 = "1.3.0"
coreKtx = "1.13.1"
appcompat = "1.7.0"
material = "1.12.0"
materialIconsExtended = "1.7.4"
navVersion = "2.8.3"
composeBom = "2024.10.00"
coilCompose = "2.4.0"
coilSvg = "2.4.0"
androidx-credentials = "1.5.0"
googleid = "1.1.1"
facebook-login = "18.0.3"
serialization = "1.9.0"
play-services-fido = "21.2.0"
play-services-auth = "1.5.0"

[libraries]
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activityCompose" }
androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "coreSplashscreen" }
androidx-datastore-preferences = { module = "androidx.datastore:datastore-preferences", version.ref = "datastore" }
androidx-material-icons-extended = { module = "androidx.compose.material:material-icons-extended", version.ref = "materialIconsExtended" }
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "navVersion" }
androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
compose-ui = { module = "androidx.compose.ui:ui", version.ref = "compose" }
compose-foundation = { module = "androidx.compose.foundation:foundation", version.ref = "compose" }
compose-material3 = { module = "androidx.compose.material3:material3", version.ref = "compose-material3" }
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" }
journey = { module = "com.pingidentity.sdks:journey", version.ref = "ping" }
external-idp = { module = "com.pingidentity.sdks:external-idp", version.ref = "ping" }
protect = { module = "com.pingidentity.sdks:protect", version.ref = "ping" }
fido = { module = "com.pingidentity.sdks:fido", version.ref = "ping" }
binding = { module = "com.pingidentity.sdks:binding", version.ref = "ping" }
binding-ui = { module = "com.pingidentity.sdks:binding-ui", version.ref = "ping" }
binding-migration = { module = "com.pingidentity.sdks:binding-migration", version.ref = "ping" }
device-profile = { module = "com.pingidentity.sdks:device-profile", version.ref = "ping" }
device-client = { module = "com.pingidentity.sdks:device-client", version.ref = "ping" }
recaptcha-enterprise = { module = "com.pingidentity.sdks:recaptcha-enterprise", version.ref = "ping" }
play-services-fido = { module = "com.google.android.gms:play-services-fido", version.ref = "play-services-fido" }
play-services-auth = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "play-services-auth" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coilCompose" }
coil-svg = { module = "io.coil-kt:coil-svg", version.ref = "coilSvg" }
androidx-credentials-play-services-auth = { group = "androidx.credentials", name = "credentials-play-services-auth", version.ref = "androidx-credentials" }
googleid = { group = "com.google.android.libraries.identity.googleid", name = "googleid", version.ref = "googleid" }
facebook-login = { module = "com.facebook.android:facebook-login", version.ref = "facebook-login" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }

13 changes: 13 additions & 0 deletions android/kotlin-journey/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#
# Copyright (c) 2026 Ping Identity Corporation. All rights reserved.
#
# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.
#

#Thu Dec 04 13:38:12 PST 2025
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
176 changes: 176 additions & 0 deletions android/kotlin-journey/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading