Giter Club home page Giter Club logo

Comments (8)

armicron avatar armicron commented on June 9, 2024 2

Don't use except without a specific exception.

except ForceChangePasswordException:

When this exception occurs you need to call set_new_password_challenge(new_password)
https://github.com/capless/warrant/blob/master/warrant/aws_srp.py#L224

from warrant.

armicron avatar armicron commented on June 9, 2024 1

@flycast it's a bad practice to use '*' in imports, be patient with it.

from warrant.

flycast avatar flycast commented on June 9, 2024

Thanks for the fast response.
Changed to:

try:
    cog.authenticate(password)
except ForceChangePasswordException:
    cog.change_password(password, new_password)

Get:

NameError: name 'ForceChangePasswordException' is not defined

from warrant.

armicron avatar armicron commented on June 9, 2024

You need to import it from
https://github.com/capless/warrant/blob/master/warrant/exceptions.py

from warrant.

flycast avatar flycast commented on June 9, 2024

Thank you for your patience and help. I really appreciate how prompt you have been.

I am a python 3 noobie. For those who run into this issue you can import the exceptions using:

from warrant.exceptions import *

from warrant.

flycast avatar flycast commented on June 9, 2024

Better to only import the bare minimum that you need?
from warrant.exceptions import ForceChangePasswordException

from warrant.

bjinwright avatar bjinwright commented on June 9, 2024

Can we close this one?

from warrant.

davidtweaver avatar davidtweaver commented on June 9, 2024

I'm loathe to re-raise this issue, but I keep getting the following error and it seems connected to this issue:


raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter AuthParameters.USERNAME, value: None, type: <type 'NoneType'>, valid types: <type 'basestring'>

My code looks like this:

cog = Cognito(identity_pool_id, app_client_id, username)
cog.new_password_challenge(password, new_password)

Where obviously those variables are set elsewhere in my code

from warrant.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.