def _do_auth(self) -> Authentication:
     user_data = {}
     self.config.cfg.read(os.path.expandvars(config.CONFIG_LOC))
     user_data["username"] = self.config.cfg.get("Paths", "roms_path")
     self.store_credentials(user_data)
     return Authentication("pcsx2_user", user_data["username"])
 async def _auth(self, tokens: dict):
     self._api.set_credentials(tokens)
     return Authentication(self._api.user_id,
                           (await self._api.get_me())['username'])
Esempio n. 3
0
 def parse_user_details(self):
     if 'id' and 'battletag' in self.user_details:
         return Authentication(self.user_details["id"], self.user_details["battletag"])
     else:
         raise InvalidCredentials()
 async def pass_login_credentials(self, step, credentials, cookies):
     self._http_client.authenticate_with_cookies(cookies)
     self._http_client.set_auth_lost_callback(self.lost_authentication)
     acc_id = await self.paradox_client.get_account_id()
     return Authentication(str(acc_id), 'Paradox')
Esempio n. 5
0
 async def pass_login_credentials(self, step, credentials, cookies):
     """Called just after CEF authentication (called as NextStep by authenticate)"""
     user_data = await self.client.authorise_with_cookies(cookies)
     self.local_client.initialize(user_data['userId'])
     self.client.set_auth_lost_callback(self.auth_lost)
     return Authentication(user_data['userId'], user_data['username'])
Esempio n. 6
0
 async def authenticate(self, stored_credentials=None):
     creds = {}
     creds["user"] = "******"
     self.store_credentials(creds)
     return Authentication("RAUser", "Retroarch")
Esempio n. 7
0
 async def pass_login_credentials(self):
     user = await self.get_user_data()
     return Authentication(user["id"], user["username"])
 async def authenticate(self, stored_credentials=None):
     return Authentication()
Esempio n. 9
0
 def do_auth(self):
     user_data = {}
     username = "******"  #Api key or something
     user_data["username"] = username
     self.store_credentials(user_data)
     return Authentication("test_user", user_data["username"])
def auth_info(profile_name):
    return Authentication(profile_name, profile_name)
Esempio n. 11
0
 def do_auth(self):
     user_data = {}
     username = user_config.roms_path
     user_data["username"] = username
     self.store_credentials(user_data)
     return Authentication("dolphin_user", user_data["username"])
def auth_info():
    return Authentication("19", "Jan")
 async def authenticate(self, stored_credentials=None):
     self.store_credentials({"dummy": "dummy"})
     return Authentication("riot_user", "Riot User")
Esempio n. 14
0
 async def authenticate(self, stored_credentials=None):
     if stored_credentials:
         user = stored_credentials
     else:
         user = await self.get_user_data()
     return Authentication(user["id"], user["username"])
Esempio n. 15
0
 def _do_auth(self) -> Authentication:
     user_data = {}
     username = user_config.roms_path
     user_data["username"] = username
     self.store_credentials(user_data)
     return Authentication("bsnes_user", user_data["username"])
def auth_info(account_id, online_id):
    return Authentication(account_id, online_id)
    def _on_auth(self):
        self.logger.info("Auth finished")
        self._init_db()

        self.store_credentials({'creds': 'dummy_data_because_local_app'})
        return Authentication('amazon_user_id', 'Amazon Games User')
 async def authenticate(self, stored_credentials=None):
     try:
         self._http_client.create_session(stored_credentials)
     except KeyError:
         log.error(
             "ROCKSTAR_OLD_LOG_IN: The user has likely previously logged into the plugin with a version less "
             "than v0.3, and their credentials might be corrupted. Forcing a log-out..."
         )
         raise InvalidCredentials()
     if not stored_credentials:
         # We will create the fingerprint JavaScript dictionary here.
         fingerprint_js = {
             r'https://www.rockstargames.com/': [
                 self.loads_js("fingerprint2.js"),
                 self.loads_js("HashGen.js"),
                 self.loads_js("GenerateFingerprint.js")
             ]
         }
         return NextStep("web_session", AUTH_PARAMS, js=fingerprint_js)
     try:
         log.info("INFO: The credentials were successfully obtained.")
         if LOG_SENSITIVE_DATA:
             cookies = pickle.loads(
                 bytes.fromhex(stored_credentials['cookie_jar']))
             log.debug("ROCKSTAR_COOKIES_FROM_HEX: " +
                       str(cookies))  # sensitive data hidden by default
         # for cookie in cookies:
         #   self._http_client.update_cookies({cookie.name: cookie.value})
         self._http_client.set_current_auth_token(
             stored_credentials['current_auth_token'])
         self._http_client.set_current_sc_token(
             stored_credentials['current_sc_token'])
         self._http_client.set_refresh_token_absolute(
             pickle.loads(bytes.fromhex(
                 stored_credentials['refresh_token'])))
         self._http_client.set_fingerprint(
             stored_credentials['fingerprint'])
         log.info(
             "INFO: The stored credentials were successfully parsed. Beginning authentication..."
         )
         user = await self._http_client.authenticate()
         return Authentication(user_id=user['rockstar_id'],
                               user_name=user['display_name'])
     except (NetworkError, UnknownError):
         raise
     except Exception as e:
         log.warning(
             "ROCKSTAR_AUTH_WARNING: The exception " + repr(e) +
             " was thrown, presumably because of "
             "outdated credentials. Attempting to get new credentials...")
         self._http_client.set_auth_lost_callback(True)
         try:
             user = await self._http_client.authenticate()
             return Authentication(user_id=user['rockstar_id'],
                                   user_name=user['display_name'])
         except Exception as e:
             log.error(
                 "ROCKSTAR_AUTH_FAILURE: Something went terribly wrong with the re-authentication. "
                 + repr(e))
             log.exception("ROCKSTAR_STACK_TRACE")
             raise InvalidCredentials
Esempio n. 19
0
 async def pass_login_credentials(self, step, credentials, cookies):
     creds = {}
     creds["user"] = "******"
     self.store_credentials(creds)
     return Authentication("RAUser", "Retroarch")
Esempio n. 20
0
 async def authenticate(self, stored_credentials=None):
     return Authentication('user_unique_id', 'Authenticated Username')