Skip to content

Commit 272a52b

Browse files
committed
Add warnings and links regarding OAuth and tokens.
Bug: 226567916 Change-Id: I4b7b738974632da1984cbca3ed88e03ecf47e58b
1 parent ee23e23 commit 272a52b

File tree

2 files changed

+39
-2
lines changed

2 files changed

+39
-2
lines changed

flask/02-sign-in/main.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,24 @@
1414
# the License.
1515
"""Entry point for the Flask server.
1616
17-
Loads the webapp module and starts the server."""
17+
Loads the webapp module and starts the server. Choose an appropriate launch
18+
method below before running this program.
19+
20+
WARNING: NOT FOR PRODUCTION
21+
----------------------------
22+
This is a sample application for development purposes. You should follow
23+
best practices when securing your production application and in particular
24+
how you securely store and use OAuth tokens.
25+
26+
Note that storing tokens in the session is for demonstration purposes. Be sure
27+
to store your tokens securely in your production application.
28+
29+
Review these resources for additional security considerations:
30+
+ Google Identity developer website: https://developers.google.com/identity
31+
+ OAuth 2.0 Security Best Current Practice:
32+
https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics
33+
+ OAuth 2.0 Threat Model and Security Considerations:
34+
https://datatracker.ietf.org/doc/html/rfc6819"""
1835

1936
from webapp import app
2037
import os

flask/03-query-parameters/main.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,27 @@
1414
# the License.
1515
"""Entry point for the Flask server.
1616
17-
Loads the webapp module and starts the server."""
17+
Loads the webapp module and starts the server. Choose an appropriate launch
18+
method below before running this program.
19+
20+
WARNING: NOT FOR PRODUCTION
21+
----------------------------
22+
This is a sample application for development purposes. You should follow
23+
best practices when securing your production application and in particular
24+
how you securely store and use OAuth tokens.
25+
26+
Note that:
27+
+ Storing tokens in the session is for demonstration purposes. Be sure to store
28+
your tokens securely in your production application.
29+
+ Be careful not to lose a user's refresh token. You will have to ask the user
30+
to re-authorize your add-on to receive a new one.
31+
32+
Review these resources for additional security considerations:
33+
+ Google Identity developer website: https://developers.google.com/identity
34+
+ OAuth 2.0 Security Best Current Practice:
35+
https://datatracker.ietf.org/doc/html/draft-ietf-oauth-security-topics
36+
+ OAuth 2.0 Threat Model and Security Considerations:
37+
https://datatracker.ietf.org/doc/html/rfc6819"""
1838

1939
from webapp import app
2040
import os

0 commit comments

Comments
 (0)