Skip to content

Commit 7630a26

Browse files
committed
refactor: cdc to ciam brand name required changes
1 parent e0f40b2 commit 7630a26

File tree

77 files changed

+667
-758
lines changed

Some content is hidden

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

77 files changed

+667
-758
lines changed

.github/workflows/bits&bytes_develop_debug.yml

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

.github/workflows/pr_e2e_gating.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ jobs:
4343
}
4444
4545
# API keys/domains for demo.variant
46-
upsert_string app/src/main/res/values/strings.xml "com.sap.cxcdc.apikey" '${{ secrets.BITS_N_BYTES_DEMO_API_KEY }}'
47-
upsert_string app/src/main/res/values/strings.xml "com.sap.cxcdc.domain" 'us1.gigya.com'
48-
upsert_string app/src/variant/res/values/strings.xml "com.sap.cxcdc.apikey" '${{ secrets.BITS_N_BYTES_VARIANT_API_KEY }}'
49-
upsert_string app/src/variant/res/values/strings.xml "com.sap.cxcdc.domain" 'us1.gigya.com'
46+
upsert_string app/src/main/res/values/strings.xml "com.sap.ciam.apikey" '${{ secrets.BITS_N_BYTES_DEMO_API_KEY }}'
47+
upsert_string app/src/main/res/values/strings.xml "com.sap.ciam.domain" 'us1.gigya.com'
48+
upsert_string app/src/variant/res/values/strings.xml "com.sap.ciam.apikey" '${{ secrets.BITS_N_BYTES_VARIANT_API_KEY }}'
49+
upsert_string app/src/variant/res/values/strings.xml "com.sap.ciam.domain" 'us1.gigya.com'
5050
5151
# Asset statements
5252
upsert_string app/src/main/res/values/strings.xml "asset_statements" '${{ secrets.BITS_N_BYTES_ASSET_STATEMENTS }}'

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ Add the SDK dependency to your app's `build.gradle.kts`:
2727

2828
```kotlin
2929
dependencies {
30-
implementation("com.sap.oss.cdc-android-sdk:cdc-android-sdk:0.3.0")
30+
implementation("com.sap.oss.ciam-android-sdk:ciam-android-sdk:0.3.0")
3131
}
3232
```
3333

34-
The library is available on [MavenCentral](https://search.maven.org/artifact/com.sap.oss.cdc-android-sdk/cdc-android-sdk).
34+
The library is available on [MavenCentral](https://search.maven.org/artifact/com.sap.oss.ciam-android-sdk/ciam-android-sdk).
3535

3636
# SDK Setup
3737

@@ -48,13 +48,13 @@ val siteConfig = SiteConfig(context)
4848

4949
```xml
5050
<!-- Mandatory -->
51-
<string name="com.sap.cxcdc.apikey">YOUR_API_KEY_HERE</string>
51+
<string name="com.sap.ciam.apikey">YOUR_API_KEY_HERE</string>
5252

5353
<!-- Optional - defaults to "us1.gigya.com" if not specified -->
54-
<string name="com.sap.cxcdc.domain">YOUR_API_DOMAIN_HERE</string>
54+
<string name="com.sap.ciam.domain">YOUR_API_DOMAIN_HERE</string>
5555

5656
<!-- Optional -->
57-
<string name="com.sap.cxcdc.cname">YOUR_CNAME_HERE</string>
57+
<string name="com.sap.ciam.cname">YOUR_CNAME_HERE</string>
5858
```
5959

6060
**Multi-flavor Support:**
@@ -556,8 +556,8 @@ class MainActivity : FragmentActivity() {
556556
super.onCreate(savedInstanceState)
557557

558558
// Initialize event bus (only needed once in your app)
559-
if (!CDCEventBusProvider.isInitialized()) {
560-
CDCEventBusProvider.initialize()
559+
if (!CIAMEventBusProvider.isInitialized()) {
560+
CIAMEventBusProvider.initialize()
561561
}
562562

563563
// Subscribe with automatic lifecycle management
@@ -597,8 +597,8 @@ class MainActivityViewModel(
597597

598598
init {
599599
// Initialize event bus
600-
if (!CDCEventBusProvider.isInitialized()) {
601-
CDCEventBusProvider.initialize()
600+
if (!CIAMEventBusProvider.isInitialized()) {
601+
CIAMEventBusProvider.initialize()
602602
}
603603

604604
// Manual subscription requires explicit cleanup
@@ -711,7 +711,7 @@ subscribeToSessionEvents { event ->
711711

712712
## Important Notes
713713

714-
⚠️ **Initialization:** Call `CDCEventBusProvider.initialize()` once in your app (e.g., in MainActivity or Application class)
714+
⚠️ **Initialization:** Call `CIAMEventBusProvider.initialize()` once in your app (e.g., in MainActivity or Application class)
715715

716716
⚠️ **Manual Subscriptions:** Always call `unsubscribe()` on manual subscriptions to prevent memory leaks
717717

@@ -728,7 +728,7 @@ The SDK provides a flexible system for integrating social login providers (Googl
728728
**Key Principle:** The SDK doesn't include social provider SDKs (Facebook SDK, Google Sign-In, etc.). Instead, you implement the authentication logic in your app and provide the results to the SDK through a standardized interface.
729729

730730
```
731-
Your App → Social Provider SDK → IAuthenticationProvider → CDC SDK → CDC Server
731+
Your App → Social Provider SDK → IAuthenticationProvider → CIAM SDK → CIAM Server
732732
```
733733

734734
## IAuthenticationProvider Interface
@@ -746,7 +746,7 @@ interface IAuthenticationProvider {
746746

747747
## AuthenticatorProviderResult
748748

749-
This is the key object that bridges your provider implementation with the CDC SDK. It contains the authentication token in a JSON format that the CDC server validates.
749+
This is the key object that bridges your provider implementation with the CIAM SDK. It contains the authentication token in a JSON format that the CIAM server validates.
750750

751751
```kotlin
752752
AuthenticatorProviderResult(
@@ -760,7 +760,7 @@ AuthenticatorProviderResult(
760760

761761
The `providerSessions` parameter is a JSON string containing authentication tokens. **The exact structure varies by provider** (Facebook uses `authToken`, Google uses `idToken`, etc.).
762762

763-
**Important:** Each social provider has its own specific JSON structure required by CDC servers. Refer to the example implementations in the app module for the exact format:
763+
**Important:** Each social provider has its own specific JSON structure required by CIAM servers. Refer to the example implementations in the app module for the exact format:
764764

765765
- **Facebook:** `app/.../provider/FacebookAuthenticationProvider.kt`
766766
- **Google:** `app/.../provider/GoogleAuthenticationProvider.kt`
@@ -867,9 +867,9 @@ These files show:
867867

868868
⚠️ **Provider Session JSON:** Each provider requires a specific JSON structure. Always refer to the example implementations for the exact format.
869869

870-
⚠️ **Provider Names:** Use the exact provider name expected by CDC servers (e.g., "facebook", "google", not "Facebook" or "GOOGLE").
870+
⚠️ **Provider Names:** Use the exact provider name expected by CIAM servers (e.g., "facebook", "google", not "Facebook" or "GOOGLE").
871871

872-
⚠️ **Dependencies:** Add social provider SDKs to your **app's** `build.gradle.kts`, not the CDC SDK. The SDK remains decoupled.
872+
⚠️ **Dependencies:** Add social provider SDKs to your **app's** `build.gradle.kts`, not the CIAM SDK. The SDK remains decoupled.
873873

874874
⚠️ **WebAuthenticationProvider:** For providers without native SDKs (LinkedIn, Twitter, etc.), use the built-in `WebAuthenticationProvider` - no custom implementation needed.
875875

app/src/main/AndroidManifest.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@
5454
</intent-filter>
5555
</service>
5656

57-
<!-- CDCNotificationReceiver handles the actions from the notification (approve/deny) -->
57+
<!-- CIAMNotificationReceiver handles the actions from the notification (approve/deny) -->
5858
<receiver
59-
android:name="com.sap.cdc.android.sdk.feature.notifications.CDCNotificationReceiver"
59+
android:name="com.sap.cdc.android.sdk.feature.notifications.CIAMNotificationReceiver"
6060
android:exported="false">
6161
<intent-filter>
6262
<action android:name="approve" />
@@ -70,14 +70,14 @@
7070
android:allowTaskReparenting="true"
7171
android:exported="true"
7272
android:launchMode="singleTask"
73-
android:theme="@style/Theme.CXCDCAndroidSDK" />
73+
android:theme="@style/Theme.CIAMAndroidSDK" />
7474

7575
<!-- SSOLoginActivity handles the redirect from the browser after a successful login -->
7676
<activity
7777
android:name="com.sap.cdc.android.sdk.feature.provider.sso.SSOLoginActivity"
7878
android:exported="true"
7979
android:launchMode="singleTask"
80-
android:theme="@style/Theme.CDC.NoAnimationActivity">
80+
android:theme="@style/Theme.CIAM.NoAnimationActivity">
8181

8282
<intent-filter>
8383

@@ -104,14 +104,14 @@
104104
android:name="com.sap.cdc.android.sdk.feature.provider.ResultLoginActivity"
105105
android:exported="true"
106106
android:launchMode="singleInstance"
107-
android:theme="@style/Theme.CDC.NoAnimationActivity" />
107+
android:theme="@style/Theme.CIAM.NoAnimationActivity" />
108108

109109
<!-- START Social providers (declarations required for WeChat, Facebook) -->
110110
<activity
111111
android:name=".wxapi.WXEntryActivity"
112112
android:exported="true"
113113
android:launchMode="singleTop"
114-
android:theme="@style/Theme.CDC.NoAnimationActivity" />
114+
android:theme="@style/Theme.CIAM.NoAnimationActivity" />
115115

116116
<meta-data
117117
android:name="com.facebook.sdk.ApplicationId"

app/src/main/java/com/sap/cdc/bitsnbytes/MainApplication.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.sap.cdc.bitsnbytes
22

33
import android.app.Application
4-
import com.sap.cdc.android.sdk.CDCDebuggable
4+
import com.sap.cdc.android.sdk.CIAMDebuggable
55

66
/**
77
* Created by Tal Mirmelshtein on 10/06/2024
@@ -14,8 +14,8 @@ class MainApplication : Application() {
1414
super.onCreate()
1515

1616
// Allow WebView debugging.
17-
CDCDebuggable.debugLogging(true)
18-
CDCDebuggable.httpLogging(true)
19-
CDCDebuggable.setWebViewDebuggable(true)
17+
CIAMDebuggable.debugLogging(true)
18+
CIAMDebuggable.httpLogging(true)
19+
CIAMDebuggable.setWebViewDebuggable(true)
2020
}
2121
}

app/src/main/java/com/sap/cdc/bitsnbytes/feature/auth/AuthenticationFlowDelegate.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ import java.util.concurrent.Executor
4444

4545
/**
4646
* Complete authentication state solution for ViewModels.
47-
* Provides direct access to CDC SDK and manages authentication state.
47+
* Provides direct access to CIAM SDK and manages authentication state.
4848
*
4949
* Key benefits:
50-
* - Direct CDC SDK access (eliminates repository passthrough)
50+
* - Direct CIAM SDK access (eliminates repository passthrough)
5151
* - Centralized authentication state management
5252
* - Activity-scoped lifecycle when used with ViewModelScopeProvider
5353
* - Single instance shared across all ViewModels
@@ -62,7 +62,7 @@ class AuthenticationFlowDelegate(context: Context) {
6262
appContext.getSharedPreferences("auth_options_state", Context.MODE_PRIVATE)
6363
}
6464

65-
// Direct CDC SDK access - eliminates repository passthrough boilerplate
65+
// Direct CIAM SDK access - eliminates repository passthrough boilerplate
6666
/**
6767
* Site configuration - use reinitializeWithNewConfig() to update
6868
*/

app/src/main/java/com/sap/cdc/bitsnbytes/feature/auth/BiometricLifecycleManager.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import androidx.lifecycle.Lifecycle
44
import androidx.lifecycle.LifecycleEventObserver
55
import androidx.lifecycle.LifecycleOwner
66
import androidx.lifecycle.ProcessLifecycleOwner
7-
import com.sap.cdc.android.sdk.CDCDebuggable
7+
import com.sap.cdc.android.sdk.CIAMDebuggable
88
import com.sap.cdc.bitsnbytes.navigation.NavigationCoordinator
99
import com.sap.cdc.bitsnbytes.navigation.ProfileScreenRoute
1010

@@ -30,7 +30,7 @@ class BiometricLifecycleManager(
3030
*/
3131
fun initialize() {
3232
ProcessLifecycleOwner.get().lifecycle.addObserver(this)
33-
CDCDebuggable.log(LOG_TAG, "BiometricLifecycleManager initialized")
33+
CIAMDebuggable.log(LOG_TAG, "BiometricLifecycleManager initialized")
3434
}
3535

3636
/**
@@ -50,7 +50,7 @@ class BiometricLifecycleManager(
5050
val currentRoute = NavigationCoordinator.INSTANCE.getCurrentRoute()
5151
authenticationFlowDelegate.setRouteBeforeLock(currentRoute)
5252

53-
CDCDebuggable.log(LOG_TAG, "App backgrounded - locking biometric session. Saved route: $currentRoute")
53+
CIAMDebuggable.log(LOG_TAG, "App backgrounded - locking biometric session. Saved route: $currentRoute")
5454
authenticationFlowDelegate.biometricLock()
5555
}
5656
}
@@ -59,17 +59,17 @@ class BiometricLifecycleManager(
5959
// Note: Don't check hasValidSession() as session will be null after lock
6060
if (authenticationFlowDelegate.isBiometricLocked()) {
6161

62-
CDCDebuggable.log(LOG_TAG, "App foregrounded - biometric is locked, checking if navigation is available")
62+
CIAMDebuggable.log(LOG_TAG, "App foregrounded - biometric is locked, checking if navigation is available")
6363

6464
// Check if navigation graph is available before attempting navigation
6565
// This prevents crashes when app starts from killed state
6666
if (isNavigationAvailable()) {
67-
CDCDebuggable.log(LOG_TAG, "Navigation available - navigating to unlock screen")
67+
CIAMDebuggable.log(LOG_TAG, "Navigation available - navigating to unlock screen")
6868
// Navigate to BiometricLocked WITHOUT clearing the backstack
6969
// This preserves the navigation history so user can return after unlock
7070
NavigationCoordinator.INSTANCE.navigate(ProfileScreenRoute.BiometricLocked.route)
7171
} else {
72-
CDCDebuggable.log(LOG_TAG, "Navigation not available yet - skipping navigation to unlock screen")
72+
CIAMDebuggable.log(LOG_TAG, "Navigation not available yet - skipping navigation to unlock screen")
7373
}
7474
}
7575
}
@@ -87,7 +87,7 @@ class BiometricLifecycleManager(
8787
return try {
8888
NavigationCoordinator.INSTANCE.isNavigationAvailable()
8989
} catch (e: Exception) {
90-
CDCDebuggable.log(LOG_TAG, "Navigation availability check failed: ${e.message}")
90+
CIAMDebuggable.log(LOG_TAG, "Navigation availability check failed: ${e.message}")
9191
false
9292
}
9393
}
@@ -98,6 +98,6 @@ class BiometricLifecycleManager(
9898
*/
9999
fun cleanup() {
100100
ProcessLifecycleOwner.get().lifecycle.removeObserver(this)
101-
CDCDebuggable.log(LOG_TAG, "BiometricLifecycleManager cleaned up")
101+
CIAMDebuggable.log(LOG_TAG, "BiometricLifecycleManager cleaned up")
102102
}
103103
}

app/src/main/java/com/sap/cdc/bitsnbytes/feature/auth/SessionMigrator.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import javax.crypto.spec.GCMParameterSpec
2424
* The migrator will decode a secured session that was created by previous SDK (v6+) and
2525
* re-secure it using current SDK standards.
2626
*
27-
* Use this class in any "init" function of your CDC SDK wrapper class to ensure migration is
27+
* Use this class in any "init" function of your CIAM SDK wrapper class to ensure migration is
2828
* preformed before any other SDK actions.
2929
*/
3030
class SessionMigrator(private val context: Context) {
@@ -48,7 +48,7 @@ class SessionMigrator(private val context: Context) {
4848
}
4949

5050
/**
51-
* Try to migrate an existing session created from an old version of the CDC SDK.
51+
* Try to migrate an existing session created from an old version of the CIAM SDK.
5252
*/
5353
fun tryMigrateSession(
5454
authenticationService: AuthenticationService,

0 commit comments

Comments
 (0)