Interface DeviceDataWebService

    • Method Detail

      • getActiveDevicesByUserId

        List<DeviceDTO> getActiveDevicesByUserId​(String userId)
        retrieve active devices that are owned by given user
        Parameters:
        userId - - target user id
        Returns:
        DeviceDTO
      • getDevicesByUserId

        List<DeviceDTO> getDevicesByUserId​(String userId)
        retrieve all devices for given user
        Parameters:
        userId - - user id
        Returns:
        - List
      • countDevicesByUserId

        int countDevicesByUserId​(String userId)
      • resetDeviceToken

        Response resetDeviceToken​(String deviceId,
                                  String newDeviceToken)
        usually device token is permanent and alive for application installation on device, but sometime it could be renew -The app deletes Instance ID -The app is restored on a new device -The user uninstalls/reinstall the app -The user clears app data.
        Parameters:
        deviceId - - internal OpenIAM device Id
        newDeviceToken - - new token coming from the device
        Returns:
        - Response with status ResponseStatus.SUCCESS is reset was success and ResponseStatus.FAILURE otherwise.
      • getDecryptedDeviceToken

        StringResponse getDecryptedDeviceToken​(String deviceId)
        method is used to get decrypted device token to use it for notification sending.
        Parameters:
        deviceId - - id of required device
        Returns:
        StringResponse with ResponseStatus.SUCCESS and decrypted token in BaseDataResponse.value if successfully decrpyted or ResponseStatus.FAILURE in case of some problems;
      • makeLoginAttemptRequestOnDevice

        Response makeLoginAttemptRequestOnDevice​(LoginAttemptRequest request)
        Send a push notification to given device with login attempt
        Parameters:
        request - LoginAttemptRequest
        Returns:
        success status in case everyting is OK.
      • getHashForTokenAndTransaction

        StringResponse getHashForTokenAndTransaction​(String deviceId,
                                                     String transactionId)
                                              throws BasicDataServiceException
        Method is used to validate response from the device for authentation attempts using push notification. Method use deviceToken (firebase token for android, concantinate it with transaction id and generate SHA-256 hash code), it's expected to get the same hash from the device, due to only OpenIAM db and device keep teal deviceToken value
        Parameters:
        deviceId - device - id of given device
        transactionId - - current transaction id
        Returns:
        hash value
        Throws:
        BasicDataServiceException