pyeve / eve-oauth2 Goto Github PK
View Code? Open in Web Editor NEWExample of a Eve powered API secured with Flask-Sentinel
Home Page: http://python-eve.org
License: Other
Example of a Eve powered API secured with Flask-Sentinel
Home Page: http://python-eve.org
License: Other
โ eve-oauth2 git:(master) โ curl -k -X POST -d "client_id=o0DKRNzRNJouovo2oJupkto8jDFwa6NouU7cOQ5N&grant_type=password&username=janreyho&password=123456" https://localhost:5000/oauth/token
<title>500 Internal Server Error</title>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
Following the existing example using eve-oauth2, I'm unable to get it to work as intended.
My requirements.txt contains the following:
eve
redis==2.10.6
oauthlib==2.1.0
requests-oauthlib==1.1.0
cryptography==2.5
flask-pymongo==0.5.2
werkzeug==0.14
flask-sentinel
When I run run.py I get the following error:
Traceback (most recent call last): File "server.py", line 24, in <module> app = Eve(settings='settings.py',auth=BearerAuth) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\site-packages\eve\flaskapp.py", line 197, in __init__ self.register_resource(resource, settings) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\site-packages\eve\flaskapp.py", line 983, in register_resource self.config["DOMAIN"][resource] File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 155, in deepcopy y = copier(x, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 243, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 182, in deepcopy y = _reconstruct(x, rv, 1, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 297, in _reconstruct state = deepcopy(state, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 155, in deepcopy y = copier(x, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 243, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 182, in deepcopy y = _reconstruct(x, rv, 1, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 297, in _reconstruct state = deepcopy(state, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 155, in deepcopy y = copier(x, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 243, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 182, in deepcopy y = _reconstruct(x, rv, 1, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 297, in _reconstruct state = deepcopy(state, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 155, in deepcopy y = copier(x, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 243, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "C:\Program Files\Continuum\Anaconda3\envs\eve\lib\copy.py", line 174, in deepcopy rv = reductor(4) TypeError: can't pickle _thread.lock objects
Appreciate your help!
I was trying to run this example and received a few errors:
from flask_sentinel import ResourceOwnerPasswordCredentials, oauth
import os
from redis.connection import ConnectionPool
SENTINEL_MONGO_URI = 'mongodb://oauth2:[email protected]/mydb?authSource=mydb'
from:
mongo.init_app(app, config_prefix='SENTINEL_MONGO')
to
mongo.init_app(app)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.