Interface IdentityStorage

    • Method Detail

      • storeAccessToken

        void storeAccessToken(AccessToken accessToken)
        Stores an AccessToken on the device
        Parameters:
        accessToken - The access token to store
      • getStoredAccessToken

        AccessToken getStoredAccessToken()
        Gets a stored AccessToken from the device.
        Returns:
        The stored AccessToken or null if one is not stored or if the storage is unavailable.
      • storeUserId

        void storeUserId(java.lang.Long userId)
        Stores a user ID for use in blips. The value should come from AccessToken.getUserId(), parsed to a Long using Long.parseLong(String).
        Parameters:
        userId - The user ID to store.
      • getUserId

        java.lang.Long getUserId()
        Gets a stored user ID from the device. This should be sent in every blip to identify the authenticated user.
        Returns:
        the user ID
      • getStoredAccessTokenAsBearerToken

        java.lang.String getStoredAccessTokenAsBearerToken()
        Gets the stored access token as a bearer value for an authorization header.
        Returns:
        A bearer token for use in an Authorization header or null. If the token is present this will be like "Bearer {token}". If the token is missing it will be null
      • getUUID

        java.lang.String getUUID()
        Gets the stored UUID of the current user or creates one if required.
        Returns:
        the UUID of the current user
      • storeIdentity

        void storeIdentity(Identity identity)
        Stores an identity.
        Parameters:
        identity - The identity to store.
      • getIdentity

        Identity getIdentity()
        Gets the stored identity.
        Returns:
        The stored identity if it is available or null if none was found.
      • anonymiseIdentity

        @Deprecated
        Identity anonymiseIdentity()
        Deprecated. As of v1.10.2.1, when COPPA is enabled, this method is no longer used. Instead, if an identity with identifying information is present, the identity is now replaced completely, wiping user storage and setting a new, empty AnonymousIdentity (using new AnonymousIdentity.Builder().build()).
        Anonymises the stored Identity

        This method will anonymise a stored AnonymousIdentity if one exists. It does not affect JWT identities.

        Returns:
        As of v1.10.2.1, this method returns getIdentity().