Skip to content

Commit cb9968a

Browse files
committed
SDKS-3917 Journey Module Design and Prototype
1 parent 431fd83 commit cb9968a

File tree

115 files changed

+5851
-645
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+5851
-645
lines changed

external-idp/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ dependencies {
3232
implementation(project(":foundation:davinci-plugin"))
3333
implementation(project(":foundation:journey-plugin"))
3434
implementation(libs.ktor.client.core)
35+
implementation(libs.androidx.startup.runtime)
3536

3637
//Make it optional for developer
3738
compileOnly(libs.googleid)

external-idp/src/main/AndroidManifest.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
~ of the MIT license. See the LICENSE file for details.
77
-->
88

9-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
9+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
10+
xmlns:tools="http://schemas.android.com/tools">
1011

1112
<application>
1213
<provider
@@ -16,10 +17,15 @@
1617
android:exported="false"/>
1718

1819
<provider
19-
android:name=".journey.IdpCallbackRegistry"
20-
android:authorities="${applicationId}.Registry"
21-
android:enabled="true"
22-
android:exported="false"/>
20+
android:name="androidx.startup.InitializationProvider"
21+
android:authorities="${applicationId}.androidx-startup"
22+
android:exported="false"
23+
tools:node="merge">
24+
<meta-data
25+
android:name="com.pingidentity.idp.journey.CallbackInitializer"
26+
android:value="androidx.startup" />
27+
</provider>
28+
2329

2430
<!-- Facebook Login -->
2531
<activity android:name=".facebook.FacebookActivity"
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
3+
*
4+
* This software may be modified and distributed under the terms
5+
* of the MIT license. See the LICENSE file for details.
6+
*/
7+
8+
package com.pingidentity.idp.journey
9+
10+
import android.content.Context
11+
import androidx.startup.Initializer
12+
import com.pingidentity.journey.plugin.CallbackRegistry
13+
14+
/**
15+
* This class is responsible for registering callbacks in the application.
16+
* It extends the Initializer interface, which means it is part of the initialization process of the application.
17+
*/
18+
class CallbackInitializer : Initializer<CallbackRegistry> {
19+
20+
override fun create(context: Context): CallbackRegistry {
21+
CallbackRegistry.register("IdPCallback", ::IdpCallback)
22+
CallbackRegistry.register("SelectIdPCallback", ::SelectIdpCallback)
23+
return CallbackRegistry
24+
}
25+
26+
override fun dependencies(): List<Class<out Initializer<*>>> {
27+
return emptyList()
28+
}
29+
}

external-idp/src/main/kotlin/com/pingidentity/idp/journey/IdpCallback.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class IdpCallback : AbstractCallback(), JourneyAware, RequestInterceptor {
4040

4141
override lateinit var journey: Journey
4242

43-
override fun onAttribute(name: String, value: JsonElement) {
43+
override fun init(name: String, value: JsonElement) {
4444
when (name) {
4545
"provider" -> this.provider = value.jsonPrimitive.content
4646
"clientId" -> this.clientId = value.jsonPrimitive.content
@@ -53,7 +53,7 @@ class IdpCallback : AbstractCallback(), JourneyAware, RequestInterceptor {
5353
}
5454
}
5555

56-
override fun asJson() = input(result.token, tokenType)
56+
override fun payload() = input(result.token, tokenType)
5757

5858
/**
5959
* Overrides the request with the resume request if initialized, else return the input request.

external-idp/src/main/kotlin/com/pingidentity/idp/journey/IdpCallbackRegistry.kt

Lines changed: 0 additions & 22 deletions
This file was deleted.

external-idp/src/main/kotlin/com/pingidentity/idp/journey/SelectIdpCallback.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class SelectIdpCallback : AbstractCallback() {
2525

2626
var value: String= ""
2727

28-
override fun onAttribute(name: String, value: JsonElement) {
28+
override fun init(name: String, value: JsonElement) {
2929
when (name) {
3030
"providers" -> {
3131
providers = value.jsonArray.map {
@@ -35,7 +35,7 @@ class SelectIdpCallback : AbstractCallback() {
3535
}
3636
}
3737

38-
override fun asJson(): JsonObject {
38+
override fun payload(): JsonObject {
3939
return input(value)
4040
}
4141

foundation/android/build.gradle.kts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ plugins {
1515

1616
android {
1717
namespace = "com.pingidentity.android"
18+
}
19+
20+
dependencies {
21+
implementation(libs.androidx.startup.runtime)
1822
}

foundation/android/src/main/AndroidManifest.xml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@
66
~ of the MIT license. See the LICENSE file for details.
77
-->
88

9-
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
9+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
10+
xmlns:tools="http://schemas.android.com/tools">
1011

1112
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
1213
<uses-permission android:name="android.permission.INTERNET" />
1314

1415
<application>
1516
<provider
16-
android:name=".InitializeProvider"
17-
android:authorities="${applicationId}.initializeProvider"
18-
android:enabled="true"
19-
android:exported="false"/>
17+
android:name="androidx.startup.InitializationProvider"
18+
android:authorities="${applicationId}.androidx-startup"
19+
android:exported="false"
20+
tools:node="merge">
21+
<meta-data
22+
android:name="com.pingidentity.android.ContextInitializer"
23+
android:value="androidx.startup" />
24+
</provider>
2025
</application>
2126

2227
</manifest>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) 2025 Ping Identity Corporation. All rights reserved.
3+
*
4+
* This software may be modified and distributed under the terms
5+
* of the MIT license. See the LICENSE file for details.
6+
*/
7+
8+
package com.pingidentity.android
9+
10+
import android.content.Context
11+
import androidx.startup.Initializer
12+
13+
/**
14+
* This class is responsible for initializing the ContextProvider in the application.
15+
* It extends the Initializer interface, which means it is part of the initialization process of the application.
16+
*/
17+
class ContextInitializer : Initializer<ContextProvider> {
18+
19+
override fun create(context: Context): ContextProvider {
20+
ContextProvider.init(context)
21+
return ContextProvider
22+
}
23+
24+
override fun dependencies(): List<Class<out Initializer<*>>> {
25+
return emptyList()
26+
}
27+
}

foundation/android/src/main/kotlin/com/pingidentity/android/InitializeProvider.kt

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)