Skip to content

Commit 5d4d0c9

Browse files
authored
Changed OAUTH calls to always use HTTPS
Always use HTTPS for OIDC redirects
2 parents 5f001b4 + a71b588 commit 5d4d0c9

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

timesketch/__init__.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,9 @@ def create_app(config=None):
9999
if app.config['UPLOAD_ENABLED']:
100100
try:
101101
from plaso import __version__ as plaso_version
102+
app.config['PLASO_VERSION'] = plaso_version
102103
except ImportError:
103104
sys.stderr.write('Upload is enabled, but Plaso is not installed.')
104-
sys.exit()
105-
app.config['PLASO_VERSION'] = plaso_version
106105

107106
# Setup the database.
108107
configure_engine(app.config['SQLALCHEMY_DATABASE_URI'])

timesketch/lib/google_auth.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ def get_oauth2_authorize_url(hosted_domain=None):
122122
"""
123123
csrf_token = _generate_random_token()
124124
nonce = _generate_random_token()
125-
redirect_uri = url_for('user_views.google_openid_connect', _external=True)
125+
redirect_uri = url_for(
126+
'user_views.google_openid_connect',
127+
_scheme='https',
128+
_external=True
129+
)
126130
scopes = ('openid', 'email', 'profile')
127131

128132
# Add the generated CSRF token to the client session for later validation.
@@ -160,7 +164,11 @@ def get_encoded_jwt_over_https(code):
160164
"""
161165

162166
discovery_document = get_oauth2_discovery_document()
163-
redirect_uri = url_for('user_views.google_openid_connect', _external=True)
167+
redirect_uri = url_for(
168+
'user_views.google_openid_connect',
169+
_scheme='https',
170+
_external=True
171+
)
164172
post_data = {
165173
'code': code,
166174
'client_id': current_app.config.get('GOOGLE_OIDC_CLIENT_ID'),

0 commit comments

Comments
 (0)