function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mickey PatelMickey Patel 

Custom App fails when connecting to sandbox but works in production

Best Answer chosen by Mickey Patel
Mickey PatelMickey Patel
I resloved the isuue at the end of this mething I had to to test url. so instead of this
await auth.UsernamePasswordAsync("Client ID got from Sandbox , "Consumer key got from Sanbox" , "mickey_patel@nwtc.com.ntcdev", "SandBox password");

I had to do this.

await auth.UsernamePasswordAsync("Client ID got from Sandbox , "Consumer key got from Sanbox" , "mickey_patel@nwtc.com.ntcdev", "SandBox password", "test url");

in production you do not need to do that.

All Answers

Raj VakatiRaj Vakati
What the app contains??  Can u share the error message what you are getting ? PLease explain more
Mickey PatelMickey Patel
our organization recently setup the Sandbox account. Before that I was able to connect the production by using:
 
var auth = new AuthenticationClient(); and await auth.UsernamePasswordAsync Method
 
now to connect to Sandbox I changed the CleintId, clientSecret, username and password to this method: auth.UsernamePasswordAsync and when I run the code I get the error message saying: {"authentication failure"}
Raj VakatiRaj Vakati
Can you check the below points 
  1. Check the endpoint URL or API URL is pointed correctly to the instance .. its might be you are URL is not correct to the integration 
  2. Check again user name and password is correct or not 
  3. Check the Remove Site Settings once 
Mickey PatelMickey Patel
Hello Raj,

 before even calling Url I am calling this method. await auth.UsernamePasswordAsync and I doubled check I have correct info.

  await auth.UsernamePasswordAsync("Client ID got from Sandbox , "Consumer key got from Sanbox" , "mickey_patel@nwtc.com.ntcdev", "SandBox password");

and I still get "authnetication failure"
 
Mickey PatelMickey Patel
I resloved the isuue at the end of this mething I had to to test url. so instead of this
await auth.UsernamePasswordAsync("Client ID got from Sandbox , "Consumer key got from Sanbox" , "mickey_patel@nwtc.com.ntcdev", "SandBox password");

I had to do this.

await auth.UsernamePasswordAsync("Client ID got from Sandbox , "Consumer key got from Sanbox" , "mickey_patel@nwtc.com.ntcdev", "SandBox password", "test url");

in production you do not need to do that.
This was selected as the best answer
Mickey PatelMickey Patel
Thank you for your help.