Skip to content

Commit a2f2276

Browse files
committed
192 Remove old SDK migration code
1 parent 1572661 commit a2f2276

File tree

11 files changed

+3
-1761
lines changed

11 files changed

+3
-1761
lines changed

README.md

+2-13
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ will help you create a client and configure the necessary data.
2424
* This SDK requires your client to be registered as a `public_mobile_client` in Self Service (see
2525
[getting started documentation](https://docs.schibsted.io/schibsted-account/gettingstarted/)
2626
for more information).
27-
* If you have implemented the
28-
[previous Schibsted Android SDK](https://github.com/schibsted/account-sdk-android) in your app,
29-
and want these users to remain logged in, don't forget to specify the `SessionStorageConfig`
30-
when creating the `Client` instance.
3127
* Using [App Links](https://developer.android.com/training/app-links) should be preferred
3228
for [security reasons](https://tools.ietf.org/html/rfc8252#appendix-B.2).
3329
To support older Android versions, configure a fallback page at the same web address to forward
@@ -64,20 +60,13 @@ implementation 'com.schibsted.account:account-sdk-android-web:<version>'
6460
```kotlin
6561
val clientConfig = ClientConfiguration(Environment.PRE, "<clientId>", "<redirect uri>")
6662
val okHttpClient = OkHttpClient.Builder().build() // this client instance should be shared within your app
67-
val sessionStorageConfig = SessionStorageConfig("<oldClientId>", "<oldClientSecret>")
6863
val client = Client(
6964
context = applicationContext,
7065
configuration = clientConfig,
71-
httpClient = okHttpClient,
72-
sessionStorageConfig = sessionStorageConfig
66+
httpClient = okHttpClient
7367
)
7468
```
75-
**Note:** `SessionStorageConfig` is only needed if your app used
76-
the [previous Schibsted Android SDK](https://github.com/schibsted/account-sdk-android),
77-
to keep migrate already logged in users.
78-
If this is not the scenario, `sessionStorageConfig` should not be specified.
79-
80-
If you need Retrofit support for making authenticated requests,
69+
**Note:** If you need Retrofit support for making authenticated requests,
8170
wrap the above client instance in a `RetrofitClient` instance:
8271

8372
```kotlin

webflows/src/main/java/com/schibsted/account/webflows/client/Client.kt

+1-19
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import com.schibsted.account.webflows.persistence.EncryptedSharedPrefsStorage
1212
import com.schibsted.account.webflows.persistence.SessionStorage
1313
import com.schibsted.account.webflows.persistence.StateStorage
1414
import com.schibsted.account.webflows.persistence.StorageError
15-
import com.schibsted.account.webflows.persistence.compat.MigratingSessionStorage
1615
import com.schibsted.account.webflows.token.TokenError
1716
import com.schibsted.account.webflows.token.TokenHandler
1817
import com.schibsted.account.webflows.token.UserTokens
@@ -46,23 +45,12 @@ class Client : ClientInterface {
4645
context: Context,
4746
configuration: ClientConfiguration,
4847
httpClient: OkHttpClient,
49-
sessionStorageConfig: SessionStorageConfig? = null,
5048
logoutCallback: (() -> Unit)? = null
5149
) {
5250
this.configuration = configuration
5351
stateStorage = StateStorage(context.applicationContext)
5452

55-
sessionStorage = if (sessionStorageConfig != null) {
56-
MigratingSessionStorage(
57-
context.applicationContext,
58-
this,
59-
sessionStorageConfig.legacyClientId,
60-
sessionStorageConfig.legacyClientSecret,
61-
sessionStorageConfig.legacySharedPrefsFilename
62-
)
63-
} else {
64-
EncryptedSharedPrefsStorage(context.applicationContext)
65-
}
53+
sessionStorage = EncryptedSharedPrefsStorage(context.applicationContext)
6654

6755
schibstedAccountApi =
6856
SchibstedAccountApi(configuration.serverUrl.toString().toHttpUrl(), httpClient)
@@ -332,9 +320,3 @@ sealed class RefreshTokenError {
332320
}
333321

334322
typealias LoginResultHandler = (Either<LoginError, User>) -> Unit
335-
336-
data class SessionStorageConfig(
337-
val legacyClientId: String,
338-
val legacyClientSecret: String,
339-
val legacySharedPrefsFilename: String? = null
340-
)

webflows/src/main/java/com/schibsted/account/webflows/persistence/compat/EncryptionKeyProvider.kt

-285
This file was deleted.

0 commit comments

Comments
 (0)