lib/fusionauth/fusionauth_client.rb in fusionauth_client-1.23.0 vs lib/fusionauth/fusionauth_client.rb in fusionauth_client-1.24.0
- old
+ new
@@ -2482,19 +2482,103 @@
.get()
.go()
end
#
- # Revokes a single refresh token, all tokens for a user or all tokens for an application. If you provide a user id
- # and an application id, this will delete all the refresh tokens for that user for that application.
+ # Revokes refresh tokens.
+ #
+ # Usage examples:
+ # - Delete a single refresh token, pass in only the token.
+ # revokeRefreshToken(token)
+ #
+ # - Delete all refresh tokens for a user, pass in only the userId.
+ # revokeRefreshToken(null, userId)
+ #
+ # - Delete all refresh tokens for a user for a specific application, pass in both the userId and the applicationId.
+ # revokeRefreshToken(null, userId, applicationId)
+ #
+ # - Delete all refresh tokens for an application
+ # revokeRefreshToken(null, null, applicationId)
+ #
+ # Note: <code>null</code> may be handled differently depending upon the programming language.
+ #
+ # See also: (method names may vary by language... but you'll figure it out)
+ #
+ # - revokeRefreshTokenById
+ # - revokeRefreshTokenByToken
+ # - revokeRefreshTokensByUserId
+ # - revokeRefreshTokensByApplicationId
+ # - revokeRefreshTokensByUserIdForApplication
#
# @param token [string] (Optional) The refresh token to delete.
# @param user_id [string] (Optional) The user id whose tokens to delete.
# @param application_id [string] (Optional) The application id of the tokens to delete.
# @return [FusionAuth::ClientResponse] The ClientResponse object.
def revoke_refresh_token(token, user_id, application_id)
start.uri('/api/jwt/refresh')
.url_parameter('token', token)
+ .url_parameter('userId', user_id)
+ .url_parameter('applicationId', application_id)
+ .delete()
+ .go()
+ end
+
+ #
+ # Revokes a single refresh token by the unique Id. The unique Id is not sensitive as it cannot be used to obtain another JWT.
+ #
+ # @param token_id [string] The unique Id of the token to delete.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def revoke_refresh_token_by_id(token_id)
+ start.uri('/api/jwt/refresh')
+ .url_segment(token_id)
+ .delete()
+ .go()
+ end
+
+ #
+ # Revokes a single refresh token by using the actual refresh token value. This refresh token value is sensitive, so be careful with this API request.
+ #
+ # @param token [string] The refresh token to delete.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def revoke_refresh_token_by_token(token)
+ start.uri('/api/jwt/refresh')
+ .url_parameter('token', token)
+ .delete()
+ .go()
+ end
+
+ #
+ # Revoke all refresh tokens that belong to an application by applicationId.
+ #
+ # @param application_id [string] The unique Id of the application that you want to delete all refresh tokens for.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def revoke_refresh_tokens_by_application_id(application_id)
+ start.uri('/api/jwt/refresh')
+ .url_parameter('applicationId', application_id)
+ .delete()
+ .go()
+ end
+
+ #
+ # Revoke all refresh tokens that belong to a user by user Id.
+ #
+ # @param user_id [string] The unique Id of the user that you want to delete all refresh tokens for.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def revoke_refresh_tokens_by_user_id(user_id)
+ start.uri('/api/jwt/refresh')
+ .url_parameter('userId', user_id)
+ .delete()
+ .go()
+ end
+
+ #
+ # Revoke all refresh tokens that belong to a user by user Id for a specific application by applicationId.
+ #
+ # @param user_id [string] The unique Id of the user that you want to delete all refresh tokens for.
+ # @param application_id [string] The unique Id of the application that you want to delete refresh tokens for.
+ # @return [FusionAuth::ClientResponse] The ClientResponse object.
+ def revoke_refresh_tokens_by_user_id_for_application(user_id, application_id)
+ start.uri('/api/jwt/refresh')
.url_parameter('userId', user_id)
.url_parameter('applicationId', application_id)
.delete()
.go()
end