hmrc / vat-api

Apache License 2.0
66 stars 17 forks source link

C# extract authorisation code from redirect url #830

Closed Grantymtd closed 3 years ago

Grantymtd commented 3 years ago

How do I extract the authorisation code from the redirect URL after authority has been granted, please. I am using C#

mPisano commented 3 years ago

Set the return type to urn:ietf:wg:oauth:2.0:oob for you application in HMRC and on the request. You need to use the embedded browser and look at redirect page with title "Success code". There was also a few reg changes to make sure winforms enabled then correct browser with javascript. Refer to my app at https://github.com/mPisano/MTDCompliance HTH - Mike

Grantymtd commented 3 years ago

Thank you Mike. I think this could be what I'm look for. I will check out your app & post my feedback shortly.

mPisano commented 3 years ago

Look at the Browser sub and Keep in mind there are two methods. Either use your own browser and copy paste the code, or use the embedded and hook the events and sniff for the success page. Let me know how it goes... Mike

Grantymtd commented 3 years ago

This works. Thank you