AquaticMasteryProductions / Robinhood-Api-Java

Java Wrapper for the Robinhood Investing App/Service
MIT License
3 stars 4 forks source link

Multi/two-factor Authorization #8

Closed JonoAugustine closed 6 years ago

JonoAugustine commented 6 years ago

Added multifactor logins by modifying the return data wrapper for basic login.

Changes:

/* You can see a test of this in the test package com.ampro.robinhood.PrivateBaseTest */
RobinhoodApi testApi = new RobinhoodApi();
String email = "email";
String pass = "password";
//Ask for the Authentication data
AuthorizationData data = testApi.requestAuthData(email, pass);
//Get the mfa code (sms, google, authy, etc)
String code = JOptionPane.showInputDialog("Code:"));
//Attemt login with mfa code
LoginStatus status = testApi.loginMultifactor(email, pass, code);

System.out.println("STATUS: ", status);
System.out.println(data);