GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation disables two-factor authentication (2FA) for a specified user in GitLab by sending a PATCH request to the GitLab API endpoint `/api/v4/users/{id}/disable_two_factor`. It is useful for administrators who need to manage user security settings, such as disabling 2FA for users who have lost access to their authentication device or require account recovery.

Use Case Examples

  1. An admin disables 2FA for a user with ID 12345 to help them regain account access.
  2. Automated workflows that manage user security settings based on organizational policies.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for testing or public endpoints.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but PATCH is used for this operation.
Path Parameters Parameters included in the request path, specifically the user ID to disable 2FA for.

Output

JSON

  • response - The JSON response from the GitLab API after disabling two-factor authentication for the user.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the user ID provided in the path parameters is valid and exists in the GitLab instance.
  • Verify that the API key used has sufficient permissions to modify user settings, including disabling two-factor authentication.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (invalid or missing API key), 404 Not Found (user ID does not exist), and 403 Forbidden (insufficient permissions). Resolving these involves verifying credentials, user ID, and permissions.

Links

Discussion