You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to deploy my app using HTTP.
The callback URL for GitHub OAuth still supports HTTP.
However, even if I set the callback URL to use HTTP, the redirect_uri is automatically changed to HTTPS when returned by the redir_url function.
I attempted to use the scheme parameter of redir_url, but it doesn’t work when host="0.0.0.0".
(Temporarily using the replace syntax resolves the issue.)
I understand that HTTPS is the standard, but I wanted to report this behavior. Below is the code I used.
# User asks us to Login@app.get("/login")deflogin(request):
redir=redir_url(request, auth_callback_path, "http") # .replace("https", "http")login_link=client.login_link(redir)
returnlogin_page(login_link)
# User comes back to us with an auth code from Github@app.get(auth_callback_path)defauth_redirect(code: str, request, session):
redir=redir_url(request, auth_callback_path, "http") # .replace("https", "http")user_info=client.retr_info(code, redir)
user_id=user_info[client.id_key]
session["user_id"] =user_idifuser_id!=authorized_user_id:
returnRedirectResponse("/protected", status_code=303)
returnRedirectResponse("/", status_code=303)
@app.get("/protected")asyncdefprotected(req):
returnnot_authorized_page()
serve(host="0.0.0.0", port=8050, reload=(notENV_MODE))
GitHub OAuth Callback URL Forcing HTTPS Despite HTTP Configuration
I want to deploy my app using HTTP.
The callback URL for GitHub OAuth still supports HTTP.
However, even if I set the callback URL to use HTTP, the
redirect_uri
is automatically changed to HTTPS when returned by theredir_url
function.I attempted to use the
scheme
parameter ofredir_url
, but it doesn’t work whenhost="0.0.0.0"
.(Temporarily using the
replace
syntax resolves the issue.)I understand that HTTPS is the standard, but I wanted to report this behavior. Below is the code I used.
Expected behavior
I hope the syntax works.
Environment Information
Please provide the following version information:
The text was updated successfully, but these errors were encountered: