Added multifactor logins by modifying the return data wrapper for basic login.
Changes:
enum RequestStatus changed to LoginStatus
Token wrapper now a nested class of new AuthorizationData which holds info on mfa & token.
AuthorizeWithoutMultifactor changed to GetAuthorizationData which returns an AuthorizationData
Added method RobinhoodApi#requestAuthData(email, password) for getting AuthData.
This will get a token if mfa is disabled or the information required to use mfa if it is required.
If mfa is then required, use RobinhoodApi#loginMultifactor(email, password, code) to login with the mfa code. Here is an exxample:
/* 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);
Added multifactor logins by modifying the return data wrapper for basic login.
Changes:
enum RequestStatus
changed toLoginStatus
Token
wrapper now a nested class of newAuthorizationData
which holds info on mfa & token.AuthorizeWithoutMultifactor
changed toGetAuthorizationData
which returns anAuthorizationData
RobinhoodApi#requestAuthData(email, password)
for getting AuthData.RobinhoodApi#loginMultifactor(email, password, code)
to login with the mfa code. Here is an exxample: