Loading

Error message "Authentication failed with status code 401" occurs when running anypoint-cli-v4 on Windows

Fecha de publicación: Mar 2, 2024
Solución

SYMPTOM

  • Error message "Authentication failed with status code 401" occurs when running anypoint-cli-v4 on Windows
  • Authentication mechanism is not overwritten by authentication flags present in the command

Steps to reproduce:

  1. Set username (ANYPOINT_USERNAME) and password (ANYPOINT_PASSWORD) in conf-cli or Windows environment variables
    For any information about anypoint-cli-v4 environment variables, please refer to this documentation
  2. Use a anypoint-cli-v4 command with inline client_id and client_secret.
    Below an example:
    anypoint-cli-v4 api-mgr:api:list --client_id <ANYPOINT_CLIENT_ID> --client_secret <ANYPOINT_CLIENT_SECRET> - -organization <ANYPOINT_ORG> --environment <ANYPOINT_ENV> -- host anypoint.mulesoft.com
    
    
  3. Notice that the following error occurs:
    Error: Authentication failed
    Login to https: //anypoint.mulesoft.com/accounts /api/v2/oauth2/token failed with
    status 401 - Unauthorized
    

CAUSE

Despite the value of the variables being handled correctly, the used variables are set to be:
  1. token
  2. username and password
  3. client_id an client_secret

WORKAROUND

As a workaround, unset authentication methods in conf-cli and Windows environment variables

SOLUTION

- This has been identified as a bug and a known issue has been submitted
- Please report to the known issue link
- To track a known issue, simply click the "Report" button on a Known Issue and you will be automatically subscribed to update from it, via your Trailblazer account.
- By default, you’ll receive status change email notifications for all Known Issues you’ve reported that impact you. You can control these preferences in your Trailblazer.me profile.
Número del artículo de conocimiento

001121091

 
Cargando
Salesforce Help | Article