Add google auth#7
Conversation
|
can you update the code to maintain the structure of project in the below specified format:
|
|
Updated according to the comments. |
YJDave
left a comment
There was a problem hiding this comment.
@tomasmor42 Thank you for working on this.
The PR looks really good. Added minor suggestions, mostly documentation modification.
Also wanted to confirm whether you have tested this with google auth or not?
| "BUNDLE_ERRORS": true | ||
| "BUNDLE_ERRORS": true, | ||
| "GOOGLE_OAUTH_CLIENT_ID":"123452-63456789234567v.apps.googleusercontent.com", | ||
| "GOOGLE_OAUTH_CLIENT_SECRET":"4rg7uj0p45tyj-oj" |
There was a problem hiding this comment.
If this is actual keys, please remove this from here and add any trash values with valid keys.
| def get(self): | ||
| resp = google.get("/oauth2/v1/userinfo") | ||
| assert resp.ok, resp.text | ||
| return make_response(jsonify({'status': 'Success'})) No newline at end of file |
There was a problem hiding this comment.
We should move this auth example in README file on in new section i.e. How to integrate google auth? with this code snippet and explanation.
| def register_blueprint(app): | ||
| ''' | ||
| This method creates and registers blueprint in application. | ||
| To create an OAuth with google you have to have GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRET which you can |
There was a problem hiding this comment.
just a little addition to the comment .. GOOGLE_OAUTH_CLIENT_SECRET in your .json configuration file which you...
| :return: | ||
| ''' | ||
| blueprint = make_google_blueprint(scope=["profile", "email"]) | ||
| app.register_blueprint(blueprint, url_prefix="/login") No newline at end of file |
There was a problem hiding this comment.
We should also add note in README on url prefix for authentication, so if anyone wants to modify it is easy for them to trace and update.
#6