none
OAuth 2.0 for HMRC RRS feed

  • Question

  • I'm designing an application that is going to connect to HMRC (UK Tax office for those not in the UK). They use OAuth 2.0. As is typical with Government web services, the documentation is convoluted to say the least. Most docs and posts I read about OAuth demonstrate how to do the server side bit. Well, this application will be the client and it will take data from a database, store it in an object, then post it to an endpoint URL with a json body containing the data, and wait for a response. In principle, relatively simple. However, I am stuck at the start with setting up OAuth and what is needed. I've read tonnes of documentation and I end up going around in circles.

    They do have a github and I'll be honest, I don't understand how github works.

    I don't see how I can write the client side of an OAuth connection without having a server side to test it with. Any help with OAuth would be great. I'm writing this in VS2017 C# and it will be a Windows Forms application. Any help with what the best template would be, or what Nuget packages you'd recommend, would be gratefully appreciated.

    Tuesday, February 19, 2019 9:48 AM

Answers

All replies

  • They do have a github and I'll be honest, I don't understand how github works.

    I don't like it, but all example code is using it. :) I don't know it usually has a download link for source code. 

    I don't see how I can write the client side of an OAuth connection without having a server side to test it with. Any help with OAuth would be great. I'm writing this in VS2017 C# and it will be a Windows Forms application. Any help with what the best template would be, or what Nuget packages you'd recommend, would be gratefully appreciated.

    https://deanhume.com/a-simple-guide-to-using-oauth-with-c/

    https://developer.okta.com/blog/2018/02/01/secure-aspnetcore-webapi-token-auth

    If you wanted to test/play with  a clinet such as a Windows desktop solution consuming a Web service that is using OAuth, then you could test/play using a WebAPI solution. IMO, you would have to deploy the ASP.NET WebAPI project to local IIS through Visual Stuido and test/debug  against local IIS with the project, a real Web server and not use IIS Express. 

    http://www.codetunnel.io/how-to-debug-your-aspnet-projects-running-under-iis/

    If you need help with WebAPI and OAuth, you can post to the WebAPI forum in ASP.NET forums.

    https://forums.asp.net/


    • Edited by DA924x Tuesday, February 19, 2019 6:14 PM
    Tuesday, February 19, 2019 11:07 AM
  • I used a third party Nuget package that manages and simplifies the process. I used TipsTrade-HMRC
    • Marked as answer by MrSnert Thursday, March 14, 2019 12:11 PM
    Thursday, March 14, 2019 12:11 PM