I am trying to connect with Xero using Named Credentials. I am using oAuth2.0 authentication protocol. 

I have created a Auth. Provider and Named credentials as shown in the image below
[![enter image description here][1]][1]


[![enter image description here][2]][2]

The Named Credentials Authentication Status is showing as pending. How to make it authenticated?

I have checked "Start Authentication Flow on Save" but once i hit on save i am getting this url "https://login.xero.com/identity/error?errorId" and error code 500.

I think i am missing some steps. Please help.

Thanks,
Soumen

  [1]: https://i.sstatic.net/qjmLl.png
  [2]: https://i.sstatic.net/4xqmS.png