I'm using Xero with c# winforms. Xero released a new topic OAuth2.0 and they are providing sample only for web applications. But I didn't get authorization code. I'm getting an html page as response not the authorization code. Can anyone help me? Thanks for the help in advance.
Here is my current code for getting authorization code:
string XeroUrl = "login.xero.com/identity/connect/authorize?response_type=code&client_id=xxxxxxxxxxxx&redirect_uri=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
string ScopeLimit = "openid profile email accounting.transactions&state=123";
string URL = "https://" + XeroUrl + "&scope=" + ScopeLimit;
try {
HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(URL);
webRequest.AllowAutoRedirect = true;
webRequest.Method = WebRequestMethods.Http.Get;
webRequest.UseDefaultCredentials = false;
webRequest.PreAuthenticate = false;
HttpWebResponse response = null;
response = (HttpWebResponse)webRequest.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string output = reader.ReadToEnd();
}