Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need help!! Can't get login working. Struggling for 2 days :( #543

Open
chulbulpande opened this issue Feb 6, 2025 · 5 comments
Open

Need help!! Can't get login working. Struggling for 2 days :( #543

chulbulpande opened this issue Feb 6, 2025 · 5 comments

Comments

@chulbulpande
Copy link

Hi friends,
I had this working a few months back and not its all broken.. can someone pleaaaaaaaaaaaaaase help me just to get past the login trouble?

@Mohasin1
Copy link

Mohasin1 commented Feb 6, 2025

even I am facing similar issue after the token is expired since today.
ERROR: There was an issue loading pickle file. Authentication may be expired - logging in normally.
Traceback (most recent call last):

raise Exception(data['detail'])

KeyError: 'detail'

@chulbulpande
Copy link
Author

I really hope someone jumps in and shows how to fix.

@alex-l-zhou
Copy link

#537 could help

@ojedaJD
Copy link

ojedaJD commented Feb 9, 2025

I am working on this

@ojedaJD
Copy link

ojedaJD commented Feb 9, 2025

I was working on rewriting the library in go, there is a different authentication verification workflow
I did this and then changed the _validate_sherrif to _validate_sherrif_id1 and device authentication now works for me.

 def _validate_sherrif_id1(device_token: str, workflow_id: str):
   url = "https://api.robinhood.com/pathfinder/user_machine/"
   payload = {
        "device_id": device_token,
        "flow": "suv",
        "input": {"workflow_id": workflow_id}
    }
  
  data = request_post(url, payload, json=True)
  
  if "id" not in data:
      raise Exception("ID not returned in verification workflow")
  
  inquiries_url = f"https://api.robinhood.com/pathfinder/inquiries/{data['id']}/user_view/"
  res = request_get(inquiries_url)
  
  challenge_id = res["type_context"]["context"]["sheriff_challenge"]["id"]
  status_url = f"https://api.robinhood.com/push/{challenge_id}/get_prompts_status/"
  
  count = 0
  while count < 3:
      print(f"Checking challenge status, attempt {count+1}...")
      status_data = request_get(status_url)
      
      challenge_status = status_data.get("challenge_status", "unknown")
      print(f"Current Challenge Status: {challenge_status}")
      
      if challenge_status == "validated":
          print("Sheriff ID validation successful.")
          inquiries_payload = {"sequence": 0, "user_input": {"status": "continue"}}
          final_data = request_post(inquiries_url, inquiries_payload, json=True)
          
          if final_data.get("type_context", {}).get("result") == "workflow_status_approved":
              print("Final workflow approval successful.")
              return
          else:
              raise Exception("Workflow approval failed.")
      
      if challenge_status == "issued":
          print("Challenge is still pending, retrying in 15 seconds...")
          time.sleep(15)
          count += 1
      else:
          break
  
  raise Exception("Sheriff challenge failed after maximum retries.")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants