Git Product home page Git Product logo

erste-bank-client's People

Contributors

angelol avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

torchtarget

erste-bank-client's Issues

Update for sIdentity 2fa

With the mandatory switch to 2fa login and the removal of the password for authentication, I've been looking in to how to support this in this program.

The initial login request is easy enough to do:

        url = 'https://login.sparkasse.at/sts/oauth/authorize?response_type=token&client_id=georgeclient'
        r = s.get(url)
        r = s.post(url, data={
            'j_username': username,
            'javaScript': 'jsOK',
            'SAMLRequest': 'ignore',
        })
        match = re.search(r"Verification code: <b>(.*)</b>", r.text)
        if match:
            code = match.groups()[0]
            print("Verification code: {}".format(code)

Where username is the Verfügernummer.

You then can poll with a GET request to https://login.sparkasse.at/sts/secapp/secondfactor?client_id=georgeclient, which returns a response like so:

{"secondFactorStatus": "PENDING", "pollingIntervalMs": 2500}

And after the 2fa signing is complete:

{"secondFactorStatus": "DONE"}

Here is a simple loop for polling:

def check_2fa(s):
    url = "https://login.sparkasse.at/sts/secapp/secondfactor?client_id=georgeclient&response_type=code"
    r = s.get(url, allow_redirects=False)
    return j.json()


def poll(s):
    while True:
        j = check_2fa(s)
        if j is None:
            return False
        if j['secondFactorStatus'] == 'ERROR':
            return False
        if j['secondFactorStatus'] == 'PENDING':
            ms = int(j['pollingIntervalMs']) + 500
            sec = ms / 1000
            time.sleep(sec)
        elif j['secondFactorStatus'] == 'DONE':
            return True
        else:
            return False

After the secondfactor endpoint reports DONE, then make a get request:

    url = 'https://login.sparkasse.at/sts/oauth/authorize?response_type=token&client_id=georgeclient'
    r = s.get(url, allow_redirects=False)

And the access token is in the Location header like before.

Adding Features: Info on the George API

Hi,
I am interested in adding a few new features, but cannot find any info on the George API. Could you point me in the right direction?
Kind regards
Christian

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.