AuthenticationThe Yahoo Finance app requires authentication to access the data it uses. To do so it uses an OAuth 2.0 process that involves a number of steps. Documentation for the Yahoo OAuth 2.0 is available here: https://developer.yahoo.com/oauth2/guide/ Consumer Key and SecretThese should only need to be entered once correctly and applied. However if for some reason they were regenerated or changed then each installed instance would need to have these updated with the new values. When copying the values for these be sure to copy the whole string that can contain letter, numbers, hypens etc. Once you apply these values you should be automatically taken to the next step of providing user authentication. User AuthenticationAfter the key and secret are applied you need to provide a Yahoo! login to grant access to the data. If you just applied the key and secret the application will automatically initiate the request process. It can fail at this point however with a "oAuth token request failed" error. It gets recorded as an (401) Unauthorized error in the error logs (Help - Read log). We found this occurred when the time and/or timezone of the host server was not in synch with the data server. Code Block |
---|
language | text |
---|
title | Sample "oAuth token request failed" / "401" error |
---|
| 4/29/2016 16:06:00 Exception: oAuth token request failed.DotNetOpenAuth.Messaging.ProtocolException: Error occurred while sending a direct message or getting the response. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.GetResponse()
at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request, DirectWebRequestOptions options)
--- End of inner exception stack trace ---
at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request, DirectWebRequestOptions options)
at DotNetOpenAuth.Messaging.StandardWebRequestHandler.GetResponse(HttpWebRequest request)
at DotNetOpenAuth.Messaging.Channel.GetDirectResponse(HttpWebRequest webRequest)
at DotNetOpenAuth.Messaging.Channel.RequestCore(IDirectedProtocolMessage request)
at DotNetOpenAuth.Messaging.Channel.Request(IDirectedProtocolMessage requestMessage)
at DotNetOpenAuth.Messaging.Channel.Request[TResponse](IDirectedProtocolMessage requestMessage)
at DotNetOpenAuth.OAuth.ConsumerBase.PrepareRequestUserAuthorization(Uri callback, IDictionary`2 requestParameters, IDictionary`2 redirectParameters, String& requestToken)
at DotNetOpenAuth.OAuth.DesktopConsumer.RequestUserAuthorization(IDictionary`2 requestParameters, IDictionary`2 redirectParameters, String& requestToken)
at OAuthBase.OAuthDesktop.BeginAuth()
at FinancePlayerClient.oAuthSetup.InitiateUserAuth() |
Login - don't Keep me signed inYou should see a login screen that prompts you for a yahoo login name and then a password. In some case we have seen upon submitting the password a .js file that wants to be opened/downloaded. It seemed that if we cleared the "Keep me signed in" checkbox (left it blank) then this didn't happen but instead the process was able to succeed. The app will open your default browser with a link that will prompt you to sign in to your Yahoo account and provide approval for the app to access the Yahoo Finance data. Image Added Once you approve it - you will be given a code. Image Added You must copy this code into the app in the provided text box and press the Go button. Image Added
|