Beispiel #1
0
    def autheniticate_me(self):
        rdio = Rdio(RDIO_CREDENTIALS)
        try:
            url = rdio.begin_authentication('oob')
            print('Go to: ' + url)
            verifier = input('Then enter code: ').strip()
            rdio.complete_authentication(verifier)
            return rdio

        except HTTPError as e:
            print(e.read())
def login():
  session_id = session['uuid']
  removeFromStore(session_id)
  rdio = Rdio(RDIO_CREDS)
  auth_url = rdio.begin_authentication(callback_url=url_for('rdio_callback', _external=True),
                                       mode='redirect')
  session_data = {'expires': datetime.datetime.now() + STORE_DURATION,
                  'rt': rdio.token[0],
                  'rts': rdio.token[1]}
  addToStore(session_id, session_data)
  return redirect(auth_url)
def login():
    session_id = session['uuid']
    removeFromStore(session_id)
    rdio = Rdio(RDIO_CREDS)
    auth_url = rdio.begin_authentication(callback_url=url_for('rdio_callback',
                                                              _external=True),
                                         mode='redirect')
    session_data = {
        'expires': datetime.datetime.now() + STORE_DURATION,
        'rt': rdio.token[0],
        'rts': rdio.token[1]
    }
    addToStore(session_id, session_data)
    return redirect(auth_url)