Skip to content

Commit

Permalink
warning for Man-in-the-middle attack in production environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyseek committed Aug 27, 2014
1 parent 1ef1695 commit b15f4b4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions flask_oauthlib/contrib/client/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import os
import contextlib
import warnings
try:
from urllib.parse import urljoin
except ImportError:
Expand Down Expand Up @@ -262,4 +263,10 @@ def insecure_transport(self):
else:
os.environ.pop('OAUTHLIB_INSECURE_TRANSPORT', None)
else:
if origin:
warnings.warn(
'OAUTHLIB_INSECURE_TRANSPORT has been found in os.environ '
'but the app is running in similar production environment.'
' It may put you in danger of the Man-in-the-middle attack'
' while using OAuth 2.', RuntimeWarning)
yield

0 comments on commit b15f4b4

Please sign in to comment.