Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversion of HTTP URLs to HTTPS in request_uris #35

Closed
weeix opened this issue Sep 19, 2023 · 2 comments · Fixed by #37 or VinamilkCorp/flask-oidc#1
Closed

Conversion of HTTP URLs to HTTPS in request_uris #35

weeix opened this issue Sep 19, 2023 · 2 comments · Fixed by #37 or VinamilkCorp/flask-oidc#1
Assignees

Comments

@weeix
Copy link

weeix commented Sep 19, 2023

Hello,

I've been testing Flask-OIDC with Keycloak and noticed that the redirect_uri sent to Keycloak is automatically converted from http://localhost:5000/oidc/callback to https://localhost:5000/oidc/callback.

According to Section 3.1.2.1 of the OAuth 2.0 specification, which discusses Endpoint Request Confidentiality:

The redirection endpoint SHOULD require the use of TLS as described in Section 1.6 when the requested response type is "code" or "token", or when the redirection request will result in the transmission of sensitive credentials over an open network. This specification does not mandate the use of TLS because at the time of this writing, requiring clients to deploy TLS is a significant hurdle for many client developers. If TLS is not available, the authorization server SHOULD warn the resource owner about the insecure endpoint prior to redirection (e.g., display a message during the authorization request).

Lack of transport-layer security can have a severe impact on the security of the client and the protected resources it is authorized to access. The use of transport-layer security is particularly critical when the authorization process is used as a form of delegated end-user authentication by the client (e.g., third-party sign-in service).

Given that the specification does not strictly mandate clients to use TLS, I propose that we allow HTTP URLs in request_uris.

Here are a few scenarios where this could be beneficial:

  • Local testing
  • Air-gapped environments

Thank you for considering this suggestion.

@sudeephazra
Copy link

This issue impacted my local development till I found out the reason. Documented here - https://stackoverflow.com/questions/77155289/flask-oidc-keycloak-https-redirect-on-localhost

@abompard abompard self-assigned this Sep 25, 2023
abompard added a commit to abompard/flask-oidc that referenced this issue Sep 25, 2023
abompard added a commit that referenced this issue Oct 9, 2023
Fix: #35
Signed-off-by: Aurélien Bompard <[email protected]>
@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Included in release Version 2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants