Receiving an Error "USERNAME_OR_PASSWORD_INCORRECT\" when trying to Authenticate to Vault
AnsweredHello,
When I try to make the connection to my sandbox environment, I receive the following response from Vault:
"{\"responseStatus\":\"EXCEPTION\",\"errors\":[{\"type\":\"USERNAME_OR_PASSWORD_INCORRECT\",\"message\":\"Authentication failed for user: null.\"}],\"errorType\":\"GENERAL\"}"
I checked the user_name and password are populated, so I was wondering if anyone knew why this error was being produced? Below is the code I am running with sensitive information replace with *****.
library(openxlsx)
library(dplyr)
library(lubridate)
library(haven)
library(openxlsx)
library(tidyverse)
library(knitr)
library(labelled)
library(httr)
library(jsonlite)
# ---- Load Functions ----
#source("../Global_Functions.R")
#source("Project_Functions.R")
# ---- Runtime Parameters ----
run_time <- Sys.time()
file_name <- paste("Subject_Listing", format(run_time,"%Y%b%d-%H%M%OS"), sep="")
report_date <- paste("Report Run:", format(run_time,"%Y-%b-%d %H:%M:%OS", sep=" "))
# ---- Load Raw Data ----
path_authenticate <- "https://sb-**********.veevavault.com/api/v22.3/auth"
user_name <- "********"
datasetList <- list()
password <-"*********"
Result <- POST(url = path_authenticate, authenticate(user_name, password))
#headers(Result)
content(Result,"text")
-
Official comment
Hi,
John and Emil are both correct. The easiest way to test any Vault API is by using our official Postman collection.
https://developer.veevavault.com/api/22.3/#run-in-postmanAlso, if you are developing an integration with Vault, you can use Vapil. Vapil is a java based library for Vault API calls. This is a great way to quickly execute Vault API calls within code that is consistent.
https://developer.veevavault.com/docs/#vault-api-library -
Hi Ahmar,
Are the username and password being passed as query string parameters? If so, that is not supported in 22R3 and they have to passed as body parameters. Below is the Postman example.
Hope this helps.
Regards,
Johnny
0 -
The API parameter is username, not user_name
0
Please sign in to leave a comment.
Comments
3 comments