1

I used to use Snowflake Connector in Python and MFA with Duo Mobile and push notifications without any problems. But after changing my smartphone to a new one, I can only use SMS and call authentification with Duo Mobile.

So now, in order to use Snowflake Connector with SMS authentification (which provides a passcode), I add the "passcode" parameter as I found on Python Connector API

I use the second parameter "passcode": Passcode parameters

This results in an error:

Error connection BDD Snowflake 250001 (08001) ... Incorrect passcode was specified.

Is it normal that I have to provide a passcode via the connector even if I have not received an SMS? (The passcode in parameter is the last one I received...)

I haven't found a solution to access Snowflake with Python, so if any one has an idea, that would be great.

SuperBanana
  • 13
  • 1
  • 3
  • 1
    You are adding **passcode** on top of the **password** parameter, right? Both need to be present. Also, the error code for **Incorrect passcode was specified** should be [390127](https://docs.snowflake.com/en/user-guide/security-mfa.html#mfa-error-codes) and not the one you get. Are you able to generate the connector [log](https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors#python) and provide a snippet from there? – Sergiu Nov 04 '21 at 10:06
  • Yeah I use both passcode and password parameters. self.connection = snowflake.connector.connect(user=user, password=password, account=account, role=role, warehouse=warehouse, database=database, passcode=passcode) I have not been able to use "logging" library as in your link, but I use this one "utils.utils_log". ERROR: 250001 (08001): Failed to connect to DB: xxxx.snowflakecomputing.com:XX. Incorrect passcode was specified. – SuperBanana Nov 04 '21 at 12:00
  • I see indeed the error is mapped to that error code in the latest releases of Python connector. Are you able to login to Snowflake UI using that SMS code? – Sergiu Nov 04 '21 at 13:18
  • I am able to login to Snowflake using browser. After I entered login and password, I choose to receive a passcode via SMS (older passcodes are invalids). I received an SMS with new passcode which is working. – SuperBanana Nov 04 '21 at 16:03
  • I tried something and it partially works. I asked a passcode via SMS via browser after login, and didn't using it for the browser but instead use it for my Python script and it's working. So the problem seems to be that I need to receive a new passcode via SMS when I'm using my Python script with the API. For the moment, I can only enter passcode in parameter. Someone knows how to do it? – SuperBanana Nov 04 '21 at 16:04
  • I believe you can't because SMS is not supported as a default authentication method in the same way that auto-push or auto-phone callback can be enabled. See more information [here](https://help.duo.com/s/article/3208?language=en_US) – Sergiu Nov 04 '21 at 19:52
  • Thanks for your help, I will use SMS passcode like that for the moment, untill I can check with my administrator to manage automatic SMS or re-enrolment of my phone in aim to have push notifications like before I hope. – SuperBanana Nov 05 '21 at 09:24

1 Answers1

0

You will always need to enter a valid passcode when using your Python script with the API. Otherwise, it will not work. Regarding the DUO Mobile push that stopped working on the new phone, please raise a Snowflake Support ticket to get the new phone re-enrol with the DUO push.

Sheng
  • 146
  • 2
  • I tried with my administrator to re-enrol the new phone but without success... He already had the problem with another person with last android phone. For now I will use Snowflake on web browser to ask the passcode and then use it with Python Thanks for your answer! – SuperBanana Nov 05 '21 at 09:21
  • There is a fix that recently got deployed by Snowflake. You need to contact the Snowflake Support team to get them to enable the fix for your Snowflake account. Once enabled, you will be able to re-enroll the new phone with DUO App. – Sheng Nov 11 '21 at 04:02