ValvePython / steam

☁️ Python package for interacting with Steam
http://steam.readthedocs.io
MIT License
1.05k stars 127 forks source link

[BUG] MobileWebAuth login doesn't work #442

Open voviz opened 1 year ago

voviz commented 1 year ago

Description MobileWebAuth login doesn't work. Function _finalise_login throws an error -

line 323, in _finalize_login
    data = json.loads(login_response['oauth'])
                      ~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'oauth'

Everything worked fine until today, so probably the response body changed. I have changed the function to

 def _finalize_login(self, login_response):
        data = login_response['transfer_parameters']
        self.steam_id = SteamID(data['steamid'])
        self.oauth_token = data['auth']

And the login seems to be ok. However steam guard can not be added Code -

wa = MobileWebAuth("LOGIN")
wa.cli_login(password="PASSWORD")
sa = SteamAuthenticator(backend=wa)
status = sa.status()

Exception -

 line 267, in status
    return self._send_request('QueryStatus', {'steamid': self.backend.steam_id})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  line 155, in _send_request
    raise SteamAuthenticatorError("Error adding via WebAPI: %s" % str(exp))
steam.guard.SteamAuthenticatorError: Error adding via WebAPI: 401 Client Error: Unauthorized for url: https://api.steampowered.com/ITwoFactorService/QueryStatus/v1/
artemiyDev commented 1 year ago

also have this problem. I think steam have changed auth process

arynyklas commented 1 year ago

Same problem

Zachxz0 commented 1 year ago

@voviz had you solved it ?

serveroid commented 1 year ago

+1

serveroid commented 1 year ago

Description MobileWebAuth login doesn't work. Function _finalise_login throws an error -

line 323, in _finalize_login
    data = json.loads(login_response['oauth'])
                      ~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'oauth'

Everything worked fine until today, so probably the response body changed. I have changed the function to

def _finalize_login(self, login_response):
       data = login_response['transfer_parameters']
       self.steam_id = SteamID(data['steamid'])
       self.oauth_token = data['auth']

And the login seems to be ok. However steam guard can not be added Code -

wa = MobileWebAuth("LOGIN")
wa.cli_login(password="PASSWORD")
sa = SteamAuthenticator(backend=wa)
status = sa.status()

Exception -

 line 267, in status
    return self._send_request('QueryStatus', {'steamid': self.backend.steam_id})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  line 155, in _send_request
    raise SteamAuthenticatorError("Error adding via WebAPI: %s" % str(exp))
steam.guard.SteamAuthenticatorError: Error adding via WebAPI: 401 Client Error: Unauthorized for url: https://api.steampowered.com/ITwoFactorService/QueryStatus/v1/

find any solution?

Rosuav commented 1 year ago

I have changed the function to

def _finalize_login(self, login_response):
       data = login_response['transfer_parameters']
       self.steam_id = SteamID(data['steamid'])
       self.oauth_token = data['auth']

And the login seems to be ok. However steam guard can not be added

Are you able to get trades to work? I haven't been able to.

REDNBLACK commented 1 year ago

Library probably needs to implement new OAuth based login and SteamGuard management to work, like here: https://github.com/geel9/SteamAuth/commit/d44e99dc976cb5a21185e1e250d46235f20f6968

hani9898 commented 1 year ago

having the same problem

h3902340 commented 1 year ago

same issue. Need to fix asap.

asa commented 1 year ago

Also hitting this.

awxk commented 1 year ago

This is still a big problem.

nan4k7 commented 11 months ago

Same problem here... any support?

lkurgan55 commented 11 months ago

Find any solution? Help pls <3

lkurgan55 commented 11 months ago

Maybe there is another way to register guard?

masterwishx commented 10 months ago

is issue fixed ?

Heehes commented 8 months ago

Is anyone working on fixing this?

lkurgan55 commented 8 months ago

Nope, use SDA, the best way to register and use steam authenticator

Rosuav commented 8 months ago

Elaborate?

Heehes commented 8 months ago

Is there any other guard generated python library