geel9 / SteamAuth

A C# library that provides vital Steam Mobile Authenticator functionality
MIT License
276 stars 102 forks source link

Use new confirmations endpoints #94

Closed Lyrapuff closed 1 year ago

Lyrapuff commented 1 year ago

Apparently Steam changed how we get confirmations, this pr should make it work again, I made a few tests and it appears to be working fine, but feel free to test it yourself to make sure

sy1989 commented 1 year ago

I think that return Array.Empty when success==false or NeedAuthentication ==true is not a good idea. You should throw new WGTokenInvalidException when success==false or NeedAuthentication ==true. But i think return ConfirmationsResponse is better

fjch1997 commented 1 year ago

I did some testing and it seems like Confirmation.ConfType is always MarketSellTransaction, when they are a trade offer. Fiddler shows the JSON contains

{
  "success": true,
  "conf": [
    {
      "type": 2,
      "type_name": "Trade Offer",
    }
  ]
}

The ConfirmationType enum type has MarketSellTransaction = 2 which is incorrect.

I suppose that the enum definition needs to be updated.

jorgermduarte commented 1 year ago

great work πŸ‘πŸΌ

jorgermduarte commented 1 year ago

I used your solution and i did a temp fix for the Steam Desktop authenticator :) πŸ•ΊπŸΌ Basically right now i used a HttpClient instead of the browser.

I didn't commit the files from the SteamAuth repo, since im using your solution, only added more fields to the Confirmation class:

        [JsonProperty(PropertyName = "headline")]
        public string Headline { get; set; }

        [JsonProperty(PropertyName = "summary")]
        public List<String> Summary { get; set; }

        [JsonProperty(PropertyName = "accept")]
        public string Accept { get; set; }

        [JsonProperty(PropertyName = "cancel")]
        public string Cancel { get; set; }

        [JsonProperty(PropertyName = "icon")]
        public string Icon { get; set; }

https://github.com/Jessecar96/SteamDesktopAuthenticator/commit/9b03d0928d100284896e4e416b2f177d4ec8b955

jorgermduarte commented 1 year ago

Here's my change on the SteamAuth project:

https://github.com/geel9/SteamAuth/commit/1dd1bae576bfc9d3ca24f2093df7426c405b2e41