Code Monkey home page Code Monkey logo

Comments (13)

dmazzer avatar dmazzer commented on August 15, 2024

Hello, I'm facing the same problem.

This is the stack trace, with DEBUG enabled.

127.0.0.1 - - [07/May/2016 10:27:05] "POST /testauth/testtoken HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/Flask-0.10.1-py2.7.egg/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python2.7/dist-packages/flask_oauthlib/provider/oauth2.py", line 489, in decorated
    uri, http_method, body, headers, credentials
  File "build/bdist.linux-x86_64/egg/oauthlib/oauth2/rfc6749/endpoints/base.py", line 64, in wrapper
    return f(endpoint, uri, *args, **kwargs)
  File "build/bdist.linux-x86_64/egg/oauthlib/oauth2/rfc6749/endpoints/token.py", line 100, in create_token_response
    request, self.default_token_type)
  File "build/bdist.linux-x86_64/egg/oauthlib/oauth2/rfc6749/grant_types/resource_owner_password_credentials.py", line 101, in create_token_response
    if not self.request_validator.authenticate_client(request):
  File "/usr/local/lib/python2.7/dist-packages/flask_oauthlib/provider/oauth2.py", line 607, in authenticate_client
    if client.client_secret != client_secret:
AttributeError: 'Client' object has no attribute 'client_secret'

Please, point me out where should I work on and I will try to fix this.
Thanks.

from flask-sentinel.

bethnull avatar bethnull commented on August 15, 2024

Me too, exceptions.AttributeError: 'Client' object has no attribute 'client_secret', after debugging it a bit the retrieved client in oauth.py line 603 doesn't have the .client_secret attribute.

The client is retrieved via client = self._clientgetter(client_id) which queries the mongodb db for the client. However in the clients collection the clients doesn't have the .client_secret attribute.

Any suggestion about how to fix that?

from flask-sentinel.

madawei2699 avatar madawei2699 commented on August 15, 2024

#10
It can be fixed by this pull request.

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

Hello folks, sorry I did not have the the time to check into this, but I plan on doing that soon! Hang in there!

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

Ah I see, it happens with Flask-Oauthlib 0.9.2. That once again shows me what happens when you don't pin your requirements (works fine with 0.8.0)

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

Actually, it also work with 0.9.1. Looks like they have a regression going on here, see https://github.com/lepture/flask-oauthlib/issues/246.

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

I am going to pin 0.9.1 until it is fixed upstream (will see if I have time to work on a PR there)

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

Also see #5

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

@lepture was really fast at looking into this. I just tested the now updated master branch of Flask-OAuthlib, and it is working fine. Next Flask-OAuthlib release will have the fix. Until then, just fallback to Flask-OAuthlib v0.9.1.

from flask-sentinel.

lepture avatar lepture commented on August 15, 2024

v0.9.3 was released.

from flask-sentinel.

bethnull avatar bethnull commented on August 15, 2024

Tested and works! Thanks guys for your support.

from flask-sentinel.

nicolaiarocci avatar nicolaiarocci commented on August 15, 2024

FYI Flask-Sentinel 0.0.5 was released.

from flask-sentinel.

ProvoK avatar ProvoK commented on August 15, 2024

edit: i've the same response but a different stacktrace
edit2: further investigation shows that is fixed in develop branch
0ddfccf

127.0.0.1 - - [12/Jan/2017 21:44:55] "POST /oauth/token HTTP/1.1" 500 -
Traceback (most recent call last):
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\eve\flaskapp.py", line 968, in call
return super(Eve, self).call(environ, start_response)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1836, in call
return self.wsgi_app(environ, start_response)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1820, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1403, in handle_exception
reraise(exc_type, exc_value, tb)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask_compat.py", line 33, in reraise
raise value
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask\app.py", line 1461, in dispatch_request
return self.view_functionsrule.endpoint
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask_oauthlib\provider\oauth2.py", line 490, in decorated
uri, http_method, body, headers, credentials
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\oauthlib\oauth2\rfc6749\endpoints\base.py", line 64, in wrapper
return f(endpoint, uri, *args, **kwargs)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\oauthlib\oauth2\rfc6749\endpoints\token.py", line 118, in create_token_response
request, self.default_token_type)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\oauthlib\oauth2\rfc6749\grant_types\resource_owner_password_credentials.py", line 112, in create_token_response
self.validate_token_request(request)
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\oauthlib\oauth2\rfc6749\grant_types\resource_owner_password_credentials.py", line 187, in validate_token_request
request.password, request.client, request):
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask_oauthlib\provider\oauth2.py", line 929, in validate_user
username, password, client, request, *args, **kwargs
File "E:\PyVENVs\DoThingsEnv\lib\site-packages\flask_sentinel\data.py", line 108, in get_user
user_hash = user['hashpw'].encode('utf-8')
AttributeError: 'bytes' object has no attribute 'encode'

from flask-sentinel.

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.