apolloconfig/apollo · error · BadRequestException

Unsupported auth type: %s

Error message

Unsupported auth type: %s

What it means

Thrown by resolveOperator when the auth type in the identity context is neither USER, USER_TOKEN, nor CONSUMER, so no operator can be resolved for the release operation.

Source

Thrown at apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ReleaseController.java:275

        || UserIdentityConstants.USER_TOKEN.equals(authType)) {
      UserInfo loginUser = userInfoHolder.getUser();
      if (loginUser == null || StringUtils.isBlank(loginUser.getUserId())) {
        throw new BadRequestException("Current user not found");
      }
      return loginUser.getUserId();
    }

    if (UserIdentityConstants.CONSUMER.equals(authType)) {
      String operator = StringUtils.isBlank(queryOperator) ? payloadOperator : queryOperator;
      RequestPrecondition.checkArguments(!StringUtils.isContainEmpty(operator),
          "operator should not be null or empty");
      if (userService.findByUserId(operator) == null) {
        throw BadRequestException.userNotExists(operator);
      }
      return operator;
    }

    throw new BadRequestException("Unsupported auth type: %s", authType);
  }

  private boolean shouldHideConfigToPortalUser(String appId, String env, String clusterName,
      String namespaceName) {
    return UserIdentityConstants.USER.equals(UserIdentityContextHolder.getAuthType())
        && unifiedPermissionValidator.shouldHideConfigToCurrentUser(appId, env, clusterName,
            namespaceName);
  }

  private void checkReleaseNamespaceReadAllowed(String appId, String env, String clusterName,
      String namespaceName) {
    String authType = UserIdentityContextHolder.getAuthType();
    if (UserIdentityConstants.USER_TOKEN.equals(authType) && unifiedPermissionValidator
        .shouldHideConfigToCurrentUser(appId, env, clusterName, namespaceName)) {
      throw new AccessDeniedException("Access is denied");
    }
    if (UserIdentityConstants.CONSUMER.equals(authType) && !unifiedPermissionValidator
        .hasReleaseNamespacePermission(appId, env, clusterName, namespaceName)) {

View on GitHub (pinned to d95fc18d11)

Solutions

  1. Authenticate using one of the supported identity types: portal user session, user token, or consumer (OpenAPI) token.
  2. Check that the Authorization or session headers are set so the auth filter populates a recognized auth type.

When it happens

Trigger: Thrown when the resolved operator principal is of an auth type the release endpoint does not support (e.g. an unexpected Principal implementation).

Common situations: A custom auth SPI returns a principal type other than consumer/portal user; misconfigured authentication provider.


AI-assisted analysis of apolloconfig/apollo@d95fc18d11 (2026-08-14). Data as JSON: /api/errors/ffecef092f5b6b98. Report an issue: GitHub.