Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

Token is empty #329

Closed
0Rudy0 opened this issue Jul 2, 2018 · 8 comments
Closed

Token is empty #329

0Rudy0 opened this issue Jul 2, 2018 · 8 comments

Comments

@0Rudy0
Copy link

0Rudy0 commented Jul 2, 2018

Hello!
Until a few days ago everything worked just fine but today when I tried to connect to the Xero app I noticed that retrieving token (https://api.xero.com/oauth/RequestToken) does not work, token is null.
Upon further investigation I noticed that the response from the previously mentioned endpoint returns a html page with the body that simply says "Sorry, something went wrong".

Based on the xero status page (https://status.xero.com/) everything works just fine so I am not sure what is the reason behind this error and was hoping that you can help me with it.

Thanks!

@MJMortimer
Copy link
Member

Hey @0Rudy0,
It sounds like your application is still running on a deprecated TLS version. The Xero API has been updated to require TLS 1.2.

There's some more information in #318 that should help you to update your application to work with TLS 1.2

@0Rudy0
Copy link
Author

0Rudy0 commented Jul 2, 2018

That was the first thing I suspected but my project is on .net 4.6.1. and just in case I checked in fiddler which TLS version was using to send requests and it was 1.2. Additionally I tried to upgrade to newest framework 4.7.2 but it didn't help.

Even when I try to use provided MVC example in this project (which I upgraded to .net 4.6.1) I get the same error, fiddler says TLS 1.2
https://i.imgur.com/CMmmpUc.png

@MJMortimer
Copy link
Member

Which fiddler tab are you seeing that?

I've just set up a blank solution using .Net 4.6.1 framework and still needed to force TLS 1.2 using ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

@0Rudy0
Copy link
Author

0Rudy0 commented Jul 3, 2018

I am using this "tutorial" to see which TLS version I am using:
https://stackoverflow.com/questions/34276358/how-to-test-which-version-of-tls-my-net-client-is-using

However interestingly, after I added
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
like you said, it works, even though in fiddler I can see version 1.2 being used with and without that part of the code. Maybe I am reading something incorrectly.
Also I was under the impression that by targeting framework 4.6.1 and above in my project it should automatically use 1.2 version but that doesn't seem to be the case, just as in your example. Any idea why?

Thanks!

@MatthewSteeples
Copy link
Contributor

@0Rudy0 Is your app running in ASP.NET? It turns out that that has a different set of defaults than console applications. We found that out the hard way too!

@0Rudy0
Copy link
Author

0Rudy0 commented Jul 3, 2018

@MatthewSteeples Ah, I see. Yes, my app is ASP.NET. Good to know, those registry settings are probably why on some server it was working and on another it wasn't.
Thanks for your help!

@MJMortimer
Copy link
Member

It seems the issue here has been resolved so I'm gonna close this issue. Please reopen if this isn't the case

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants