squatto / alfred-imessage-2fa

iMessage 2FA Workflow for Alfred
MIT License
111 stars 7 forks source link

Not working with BOA and Cigna #7

Closed tmm closed 4 years ago

tmm commented 4 years ago

Just downloaded the workflow from Packal and tried to use with Bank of America and Cigna, but they aren't showing up in Alfred:

image

Here are the 2fa messages I received from them:

<#>BofA: Your code is XXXXXX. Don't share it; we won't call to ask for it. Call 800.933.6262 if you didn't request it.
Your Cigna authentication code is XXXXXX.
squatto commented 4 years ago

Thank you for the feedback! Are the codes 6 digits or are there non-digits in the code?

tmm commented 4 years ago

They are six digits. No letters or special characters.

squatto commented 4 years ago

Every so often I have an issue where macOS doesn't seem to flush the recent messages to the database file. I'm wondering if that is what is happening, especially considering the fact that it is reading your other messages. If you reboot and trigger another code being sent to you from Cigna/BoA, does it read the new codes?

tmm commented 4 years ago

Just rebooted and tried again with BOA, and unfortunately did not work. Is there another way to update the database file?

tmm commented 4 years ago

It worked today for a Microsoft account. The only difference I can tell between the Microsoft SMS and Cigna/BOA is that the number they were sent from has a different number of digits.

The Microsoft number had six digits in the following format: XXX-XXX, and the Cigna/BOA had five: XXX-XX.

This thing is magical when it works!

manonstreet commented 4 years ago

I was having a similar problem with a number of providers. The issue is in line 88 of the find-messages.php if (preg_match('/(^|\s|\R|\t|G-)(\d{5,8})($|\s|\R|\t)/', $message['text'], $matches)) {

This regex won't detect a 2fA code if it is immediately proceeded by a period. Changing the regex to: if (preg_match('/(^|\s|\R|\t|G-)(\d{5,8})($|\s|\R|\t|\.)/', $message['text'], $matches)) {

fixes the issue :)

tmm commented 4 years ago

@manonstreet you seem to know what you are doing - do you mind opening up a pull request?

squatto commented 4 years ago

This is fixed in v1.2.1 (download) - thanks @tmm and @manonstreet!