Releases: authsignal/authsignal-php
4.0.0
Release Notes
Changes have been made so that conventions used in the PHP SDK align with Authsignal's general SDK conventions.
Breaking Changes
-
track
Method- Old Signature:
public static function track(string $userId, string $action, array $payload)
- New Signature:
public static function track(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user you are tracking the action for.action
(string): The action code that you are tracking.attributes
(array): An array of attributes to track.
- Changes:
- The method now accepts a single associative array parameter named
$params
. - The
payload
parameter has been replaced withattributes
in the implementation.
- The method now accepts a single associative array parameter named
- Old Signature:
-
getAction
Method- Old Signature:
public static function getAction(string $userId, string $action, string $idempotencyKey)
- New Signature:
public static function getAction(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user you are tracking the action for.action
(string): The action code that you are tracking.idempotencyKey
(string): The idempotency key for the action.
- Changes:
- The method now accepts a single associative array parameter named
$params
.
- The method now accepts a single associative array parameter named
- Old Signature:
-
getUser
Method- Old Signature:
public static function getUser(string $userId, string $redirectUrl = null)
- New Signature:
public static function getUser(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user you are tracking the action for.
- Changes:
- The method now accepts a single associative array parameter named
$params
. - Removed redirectUrl from the params.
- The method now accepts a single associative array parameter named
- Old Signature:
-
updateUser
Method- Old Signature:
public static function updateUser(string $userId, array $data)
- New Signature:
public static function updateUser(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user to update.attributes
(array): The attributes to update for the user.
- Changes:
- The method now accepts a single associative array parameter named
$params
.
- The method now accepts a single associative array parameter named
- Old Signature:
-
enrollVerifiedAuthenticator
Method- Old Signature:
public static function enrollVerifiedAuthenticator(string $userId, array $authenticator)
- New Signature:
public static function enrollVerifiedAuthenticator(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user you are tracking the action for.attributes
(array): The authenticator object to enroll.
- Changes:
- The method now accepts a single associative array parameter named
$params
.
- The method now accepts a single associative array parameter named
- Old Signature:
-
deleteUser
Method- Old Signature:
public static function deleteUser(string $userId)
- New Signature:
public static function deleteUser(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user you want to delete.
- Changes:
- The method now accepts a single associative array parameter named
$params
.
- The method now accepts a single associative array parameter named
- Old Signature:
-
deleteAuthenticator
Method- Old Signature:
public static function deleteAuthenticator(string $userId, string $userAuthenticatorId)
- New Signature:
public static function deleteAuthenticator(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user.userAuthenticatorId
(string): The userAuthenticatorId of the authenticator to delete.
- Changes:
- The method now accepts a single associative array parameter named
$params
.
- The method now accepts a single associative array parameter named
- Old Signature:
-
validateChallenge
Method- Old Signature:
public static function validateChallenge(string $token, string $userId = null, string $action = null)
- New Signature:
public static function validateChallenge(array $params)
- Parameters in Associative Array:
token
(string): The JWT token string returned on a challenge response.userId
(string|null): The userId of the user you are tracking the action for (optional).action
(string|null): The action code that you are tracking (optional).
- Changes:
- The method now accepts a single associative array parameter named
$params
.
- The method now accepts a single associative array parameter named
- Old Signature:
-
Rename
setApiKey
Method tosetApiSecretKey
-
Rename
getApiKey
Method togetApiSecretKey
-
Rename
setApiHostname
tosetApiUrl
-
Rename
AUTHSIGNAL_SERVER_API_ENDPOINT
env var toAUTHSIGNAL_API_URL
-
Remove
setApiVersion
andgetApiVersion
- The version should be set when the URL is set with
setApiUrl
or theAUTHSIGNAL_API_URL
env variable.
Non Breaking Changes
-
Add
updateAction
Method- Signature:
public static function updateAction(array $params)
- Parameters in Associative Array:
userId
(string): The userId of the user to update the action for.action
(string): The action code to update.idempotencyKey
(string): The idempotency key for the action.attributes
(array): Additional attributes for the action.
- Signature:
-
**
getAuthenticators
Method**
- Signature:
public static function getAuthenticators(array $params)
- Description: Retrieves the list of authenticators for a specified user.
- Parameters in Associative Array:
userId
(string): The userId of the user whose authenticators you want to retrieve.
- Returns: An array containing the list of user authenticators.
- Throws:
AuthsignalApiException
if the request fails.
Example Usage:
$params = [
'userId' => '12345' // The userId of the user whose authenticators you want to retrieve
];
$authenticators = Authsignal::getAuthenticators($params);
3.0.1
Bug fix
- Fix issue where 300 -> 399 range API responses were causing an error to be thrown.
3.0.0
Breaking Changes:
- Rename
deleteUserAuthenticator
todeleteAuthenticator
for consistency. - Omit deprecated
actionCode
fromvalidateChallenge
response.
Other changes:
- Omit keys with null values from API requests by default.
- Add action option in
validateChallenge
method: Ensures that the validated action matches the tracked action when the action parameter is provided.
2.0.2
2.0.2 Release Notes
New Features
deleteUser
- Description: This method allows for the deletion of a user from Authsignal.
- Parameters:
$userId (string)
: The unique identifier of the user to be deleted.
- Returns:
array('success' => true)
deleteUserAuthenticator
- Description: This method securely deletes a user's authenticator.
- Parameters:
$userId (string)
: The unique identifier of the user.
- Returns:
array('success' => true)
updateUser
- Description: Updates the details of an existing user.
- Parameters:
$userId (string)
: The user's unique identifier.$data (array)
: Updated user details.
- Returns: The updated user as an associative array.
2.0.0
This change simplifies the validateChallenge function by calling Authsignal's API to validate a challenge.
Breaking changes:
validateChallenge now returns isValid
instead of success