Skip to content

Commit

Permalink
fixing double encoding bug for OAuth JWTs
Browse files Browse the repository at this point in the history
  • Loading branch information
fisjac committed Oct 24, 2024
1 parent 6e42328 commit 5872351
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions superset/utils/oauth2.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import jwt
from flask import current_app, url_for
from marshmallow import EXCLUDE, fields, post_load, Schema
from urllib.parse import unquote

from superset import db
from superset.distributed_lock import KeyValueDistributedLock
Expand Down Expand Up @@ -169,6 +170,8 @@ def decode_oauth2_state(encoded_state: str) -> OAuth2State:
"""
Decode the OAuth2 state.
"""
# Before escaping periods, the % need to be escaped
encoded_state = unquote(encoded_state)
# Google OAuth2 needs periods to be escaped.
encoded_state = encoded_state.replace("%2E", ".")

Expand Down

0 comments on commit 5872351

Please sign in to comment.