Comments (2)
Hi there! Sorry for the late reply. Let me investigate a bit more into where this can happen, not an OAuth expert so I'll need to do some homework.
from getting-started-python.
Similar to the example mentioned in SO: https://github.com/mitsuhiko/flask-oauth/blob/master/example/google.py, it would fall under bookshelf/main.py
. The code now looks like this: (adding in line numbers to help)
44 # [END upload_image_file]
45
46
47 app = Flask(__name__)
48 app.config.update(
49 SECRET_KEY='secret',
50 MAX_CONTENT_LENGTH=8 * 1024 * 1024,
51 ALLOWED_EXTENSIONS=set(['png', 'jpg', 'jpeg', 'gif'])
52 )
53
54 app.debug = False
55 app.testing = False
if you wanted to add OAuth bit, you'd add a bit of a section after the snippet above:
44 # [END upload_image_file]
45
46
47 app = Flask(__name__)
48 app.config.update(
49 SECRET_KEY='secret',
50 MAX_CONTENT_LENGTH=8 * 1024 * 1024,
51 ALLOWED_EXTENSIONS=set(['png', 'jpg', 'jpeg', 'gif'])
52 )
53
54 app.debug = False
55 app.testing = False
56 # Don't forget to import:
57 from flask_oauth import OAuth
58 # You must configure these 3 values from Google APIs console
59 # https://code.google.com/apis/console
60 GOOGLE_CLIENT_ID = '<Client-ID>'
61 GOOGLE_CLIENT_SECRET = '<Client-secret>'
62 oauth = OAuth()
63
64 google = oauth.remote_app('google',
65 base_url='https://www.google.com/accounts/',
66 authorize_url='https://accounts.google.com/o/oauth2/auth',
67 request_token_url=None,
68 request_token_params={'scope': 'https://www.googleapis.com/auth/userinfo.email',
69 'response_type': 'code'},
70 access_token_url='https://accounts.google.com/o/oauth2/token',
71 access_token_method='POST',
72 access_token_params={'grant_type': 'authorization_code'},
73 consumer_key=GOOGLE_CLIENT_ID,
74 consumer_secret=GOOGLE_CLIENT_SECRET)
Note that the SO post talks about HD
flag being discouraged. This answer is long overdue but hope it helps for anyone else!
I'll be closing this issue for now, but if there's any followup questions to this topic please feel free to re-open it with more info! :)
from getting-started-python.
Related Issues (20)
- 'from google.cloud import store' should be 'datastore' HOT 1
- Error: google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS HOT 2
- Cannot clone git synced repo from google cloud source repository HOT 1
- Folder column in the README is all 404's HOT 2
- bookshelf error on App Engine: "ImportError: cannot import name 'secure_filename' from 'werkzeug'" HOT 7
- testing: enable the Build Cop Bot HOT 1
- Cannot upload image HOT 1
- cleanup: snippet-bot full scan HOT 1
- Action Required: Fix Renovate Configuration
- Bookshelf requirements dependencies broken HOT 3
- 1-hello-world Directory won't exist HOT 3
- Conflicting dependencies in bookshelf app HOT 1
- issues following tutorial HOT 5
- Dependency Dashboard
- Add tests and automated CI HOT 3
- Update testing infrastructure to use Python 3.7 or higher
- Update the Ops Agent script via GitHub Workflow
- Update primary reviewer to python-samples-reviewers
- [email protected]/[email protected]
- Replace python-jose dependency HOT 2
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 getting-started-python.