captin411 / ofxclient

Bank transaction downloader and python OFX client libraries
MIT License
261 stars 89 forks source link

Invalid ID error #67

Open mattcarlin opened 5 years ago

mattcarlin commented 5 years ago

I recently posted another issue about being unable to connect to Chase bank. Whenever I typed ofxclient into my command prompt, it would just tell me authentication failed. That problem was fixed (thanks to some help from you guys) by simply typing ofxclient --ofx-version 103. However, I was immediately met with another issue; when I type my username and password and hit enter, it gives me authentication failed: INVALID ID/PASSWORD even though I can log in to my chase account just fine with the same credentials.

I found this (https://github.com/captin411/ofxclient/issues/15) article, but am not really sure if it will solve my problem; plus I am not even sure how to do what the people in the thread are talking about.

I thought it might be an issue with the command prompt version of ofxclient, so I pip installed ofxclient for python 3 and tested the example from the front page in jupyter notebook (id = '10898', org = 'B1', url = 'https://ofx.chase.com'). The error I got was ModuleNotFoundError: No module named 'ofxclient', even though I had just installed it.

My next thought was to try the python method but from the command prompt instead of jupyter notebook.

C:\Users\my_username>python
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 22:20:52) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>from ofxclient import Institution
>>>inst = Institution(id='10898',org='B1',url='https://ofx.chase.com',username='my_username',password='my_password')
>>>accounts=inst.accounts()
>>>for a in accounts:
    ...     download=a.download(days=5)
    ...     print(download.read())
    ...     statement = a.statement(days=5)
    ...     print(statement.balance)
    ...
>>>

As you can see, it seems to be able to tell that the module is installed, and it didn't give me any username/password error, but it doesn't print anything. I am extremely frustrated with this because I know that when I get it to work, ofxclient will be extremely powerful. Any and all help would be very much appreciated.

philipsd6 commented 5 years ago

You'll need to do the following to use this with Chase:

  1. Generate a uuid (either with openssl rand -hex 16 or online at https://www.uuidgenerator.net/
  2. Run this once:
    
    import logging
    logging.basicConfig(level=logging.DEBUG)

from ofxclient import Institution

client_args = dict(ofx_version='103', id='')

inst = Institution(id='10898', org='B1', url='https://ofx.chase.com', username='my_username', password='my_password' client_args=client_args)

accounts = inst.accounts() for account in accounts: print(account.description, account.number_masked())

3. You'll probably see something like this in the output:
```xml
<OFX><SIGNONMSGSRSV1><SONRS><STATUS><CODE>15510<SEVERITY>ERROR<MESSAGE>Please verify your identity within the next 7 days. Using your d
esktop computer, go to your banks website and visit the Secure Message Center for instructions.</STATUS><DTSERVER>20190423200641.611[-4
:EDT]<LANGUAGE>ENG<FI><ORG>B1<FID>10898</FI></SONRS></SIGNONMSGSRSV1><SIGNUPMSGSRSV1><ACCTINFOTRNRS><TRNUID>7aa314891e407a46b922bbbdee1
51796<STATUS><CODE>15500<SEVERITY>ERROR</STATUS><CLTCOOKIE>4</ACCTINFOTRNRS></SIGNUPMSGSRSV1></OFX>                                    
  1. Then sign into your Chase account and go to your secure messages, and click the link in that message.
  2. Then run the above code again! Just be sure to keep using the same uuid.

WARNING Your username and password will be in the debug output, so don't cut-n-paste it without sanitizing it!

mattcarlin commented 5 years ago

DEBUG:root:posting data to https://ofx.chase.com DEBUG:root:---- request ---- DEBUG:root:OFXHEADER:100 DATA:OFXSGML VERSION:103 SECURITY:NONE ENCODING:USASCII CHARSET:1252 COMPRESSION:NONE OLDFILEUID:NONE NEWFILEUID:2154215485304335ab198bc19fd3053f

20190427161342 username password ENG B1 10898 QWIN 2500 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 4 19700101000000

DEBUG:root:---- response ---- DEBUG:root:{'fp': None, 'debuglevel': 0, '_method': 'POST', 'headers': <http.client.HTTPMessage object at 0x015B0110>, 'msg': <http.client.HTTPMessage object at 0x015B0110>, 'version': 11, 'status': 200, 'reason': 'OK', 'chunked': False, 'chunk_left': 'UNKNOWN', 'length': 0, 'will_close': False, 'code': 200} DEBUG:root:OFXHEADER:100 DATA:OFXSGML VERSION:103 SECURITY:NONE ENCODING:USASCII CHARSET:1252 COMPRESSION:NONE OLDFILEUID:NONE NEWFILEUID:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

15500ERRORINVALID ID/PASSWORD20190427171343.252[-4:EDT]ENGB110898xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx15500ERROR4

On Sat, Apr 27, 2019 at 4:29 PM Matthew Carlin carlinm@aggienetwork.com wrote:

So this is farther than I have gotten before, but it still gives me an error about incorrect username and password.

15500ERRORINVALID ID/PASSWORD20190427171343.252[-4:EDT]ENGB110898ab03774ebe9a47649ed7a89c80dca85d15500ERROR4

I hadn't set up a uuid so that seems to have helped, but still no dice on accessing the account.

On Tue, Apr 23, 2019 at 7:36 PM Philip Douglass notifications@github.com wrote:

You'll need to do the following to use this with Chase:

  1. Generate a uuid (either with openssl rand -hex 16 or online at https://www.uuidgenerator.net/
  2. Run this once:

import logging logging.basicConfig(level=logging.DEBUG) from ofxclient import Institution

client_args = dict(ofx_version='103', id='')

inst = Institution(id='10898', org='B1', url='https://ofx.chase.com', username='my_username', password='my_password' client_args=client_args)

accounts = inst.accounts()for account in accounts: print(account.description, account.number_masked())

  1. You'll probably see something like this in the output:
15510ERRORPlease verify your identity within the next 7 days. Using your d esktop computer, go to your banks website and visit the Secure Message Center for instructions.20190423200641.611[-4 :EDT]ENGB1108987aa314891e407a46b922bbbdee1 5179615500ERROR4
  1. Then sign into your Chase account and go to your secure messages, and click the link in that message.
  2. Then run the above code again! Just be sure to keep using the same uuid.

WARNING Your username and password will be in the debug output, so don't cut-n-paste it without sanitizing it!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/captin411/ofxclient/issues/67#issuecomment-486023325, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBTX3KN4SKO7UP4UDHT4LPR6TQXANCNFSM4HFQIBXA .

-- Regards, Matthew Carlin (972) 571-6121

-- Regards, Matthew Carlin (972) 571-6121

jcguu95 commented 4 years ago

How did it go?