Comments (13)
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.
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.
#10
It can be fixed by this pull request.
from flask-sentinel.
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.
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.
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.
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.
Also see #5
from flask-sentinel.
@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.
v0.9.3 was released.
from flask-sentinel.
Tested and works! Thanks guys for your support.
from flask-sentinel.
FYI Flask-Sentinel 0.0.5 was released.
from flask-sentinel.
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)
- How to validate user data by cerberus?
- Error while trying to generate a new token :: 'bytes' object has no attribute 'encode' HOT 2
- Pypi package not updated (0.0.5 vs 0.0.6) HOT 2
- pip install breaks pip / fails HOT 1
- user hash encoding with python 3 HOT 4
- how to refresh token? HOT 5
- invalid_grant
- Problem with flask config
- 500 Internal Server Error for "oauth/management"
- Authorization not working HOT 1
- No check for duplicate username
- Project Requires MongoDB, Doesn't provide other DB support.
- How can I generate client token using post api?
- ResourceOwnerPasswordCredentials(app) fails with Unknown option config_prefix error HOT 3
- Linking client_id to a specific endpoint
- 500 Error on correct username and password.
- Cannot import module HOT 1
- Breaking changes with werkzeug==1.0.0 HOT 3
- Switch to authlib HOT 1
- v0.0.7 'save_token' is not handling 'access_token' typecasting according to how redis wants it HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flask-sentinel.