AnsweredAssumed Answered

Unable to Generate Credentials for ArcGIS Online

Question asked by david.mccorkindale_qgsp on Jun 21, 2016
Latest reply on Jun 22, 2016 by david.mccorkindale_qgsp

Hi,

 

I'm try to use token based authentication to get to my organisation portal on ArcGIS online using the ESRI ArcGISRuntime for .NET.

 

When trying to run the below code I get the following error.

 

Any help would be appreciated.

 

Code:

 

string uri = @"https://qgsp.maps.arcgis.com/sharing/rest";

 

"Starting credentials.");

 

var credentials = await IdentityManager.Current.GenerateCredentialAsync(uri, username, password) as ArcGISTokenCredential;

 

Error:

Unhandled Exception: System.AggregateException: One or more errors occurred. ---
> System.Net.Http.HttpRequestException: An error occurred while sending the requ
est. ---> System.Net.WebException: Unable to connect to the remote server ---> S
ystem.Net.Sockets.SocketException: A connection attempt failed because the conne
cted party did not properly respond after a period of time, or established conne
ction failed because connected host has failed to respond 50.17.189.113:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Sock
et s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state,
IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, Tr
ansportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar
)
   --- End of inner exception stack trace ---
   at Esri.ArcGISRuntime.Http.ArcGISHttpClientHandler.ArcGISClientHandlerInterna
l.<SendAsync>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at Esri.ArcGISRuntime.Security.ArcGISTokenWebRequest.<RequestTokenAsync>d__1.
MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at Esri.ArcGISRuntime.Security.ArcGISTokenCredential.<GetArcGISTokenAsync>d__
d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Esri.ArcGISRuntime.Security.ArcGISTokenCredential.<GenerateTokenImplAsync>
d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at Esri.ArcGISRuntime.Security.TokenCredential.<GenerateTokenAsync>d__d.MoveN
ext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
ification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at DownloadSurvey.Program.<Login>d__3.MoveNext() in C:\Users\mccorkdm\documen
ts\visual studio 2015\Projects\DownloadSurvey\DownloadSurvey\Program.cs:line 39
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceled
Exceptions)
   at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotifica
tion)
   at System.Threading.Tasks.Task`1.get_Result()
   at DownloadSurvey.Program.Main(String[] args) in C:\Users\mccorkdm\documents\
visual studio 2015\Projects\DownloadSurvey\DownloadSurvey\Program.cs:line 22

Attachments

Outcomes