Skip to content

Commit

Permalink
try to fix c3hub sso
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 24, 2024
1 parent 97a39ea commit be7c8ce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,17 @@ def oauth2_callback(provider):
"grant_type": "authorization_code",
"redirect_uri": url_for("oauth2_callback", provider=provider, _external=True),
}
headers = {
"Accept": "application/json",
}
if SSO_CONFIG[provider]["challenge_instead_of_state"]:
params["code_verifier"] = session["oauth2_state"]
headers["Content-Type"] = "application/x-www-form-urlencoded"

r = requests.post(
SSO_CONFIG[provider]["token_url"],
data=params,
headers={"Accept": "application/json"},
headers=headers,
)
if r.status_code != 200:
abort(400)
Expand Down
4 changes: 2 additions & 2 deletions util/sso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
SSO_CONFIG = {
"c3hub": {
"display_name": "38C3 Hub",
"authorize_url": "https://events.ccc.de/congress/2024/hub/sso/authorize",
"token_url": "https://events.ccc.de/congress/2024/hub/sso/token",
"authorize_url": "https://events.ccc.de/congress/2024/hub/sso/authorize/",
"token_url": "https://events.ccc.de/congress/2024/hub/sso/token/",
"scopes": ["38c3_attendee"],
"userinfo_url": "https://api.events.ccc.de/congress/2024/me",
"challenge_instead_of_state": True,
Expand Down

0 comments on commit be7c8ce

Please sign in to comment.