Class BasicAuthInMemoryStore
-
- All Implemented Interfaces:
-
com.sap.cloud.mobile.foundation.authentication.BasicAuthCredentialStore
public class BasicAuthInMemoryStore implements BasicAuthCredentialStore
This class implements BasicAuthCredentialStore by simply keeping a hashmap in memory (there is no persistence across app restarts).
-
-
Constructor Summary
Constructors Constructor Description BasicAuthInMemoryStore()
-
Method Summary
Modifier and Type Method Description synchronized void
storeCredential(@NonNull() String rootUrl, @NonNull() String realm, @NonNull() Array<String> credentials)
Stores credentials for future use. synchronized Array<String>
getCredential(@NonNull() String rootUrl, @NonNull() String realm)
Gets stored credentials for reuse. synchronized void
deleteCredential(@NonNull() String rootUrl, @NonNull() String realm)
Deletes the stored credentials for a given root URL and realm. synchronized void
deleteAllCredentials()
Deletes all stored credentials. -
-
Method Detail
-
storeCredential
synchronized void storeCredential(@NonNull() String rootUrl, @NonNull() String realm, @NonNull() Array<String> credentials)
Stores credentials for future use.
- Parameters:
rootUrl
- The root URL for which the credentials should be used for.realm
- The realm for which the credentials should be used for.credentials
- This array should have a length of 2.
-
getCredential
@Nullable() synchronized Array<String> getCredential(@NonNull() String rootUrl, @NonNull() String realm)
Gets stored credentials for reuse.
- Parameters:
rootUrl
- The root URL for which the credentials are being requested for.realm
- The realm for which the credentials are being requested for.- Returns:
The stored credentials or null if none are stored for the given rootUrl and realm.
-
deleteCredential
synchronized void deleteCredential(@NonNull() String rootUrl, @NonNull() String realm)
Deletes the stored credentials for a given root URL and realm.
- Parameters:
rootUrl
- The rootUrl for which the credentials should be deleted.realm
- The realm for which the credentials should be deleted.
-
deleteAllCredentials
synchronized void deleteAllCredentials()
Deletes all stored credentials.
-
-
-
-