-
Notifications
You must be signed in to change notification settings - Fork 56
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
(insecure_transport) OAuth 2 MUST utilize https. #59
Comments
Hi.
This is a well-known “issue” which is documented here: https://github.com/conwetlab/ckanext-oauth2/wiki/Activating-and-Installing. In case your OAuth server is using HTTP, you must set an environment variable.
Regards
Aitor
… El 3 ago 2022, a las 7:37, higuchi-toshio-intec ***@***.***> escribió:
Very thanks for your project.
My execution environment is built with these versions.
AWS Fargate
CKAN [2.9.5]
ckanext-oauth2 [0.7.0]
Amazon ELB (for "https" front-end listener)
Amazon Cognito
On my execution environment, I got a error.
I tried to fix it.
I hope you like the following.
diff --git a/ckanext/oauth2/oauth2.py b/ckanext/oauth2/oauth2.py
index 28a2724..cc9c782 100644
--- a/ckanext/oauth2/oauth2.py
+++ b/ckanext/oauth2/oauth2.py
@@ -115,10 +115,14 @@ class OAuth2Helper(object):
)
try:
+ req_url = toolkit.request.url
+ ckan_site_url = os.environ.get('CKAN_SITE_URL')
+ if (ckan_site_url.startswith("https:")):
+ req_url = req_url.replace("http:", "https:")
token = oauth.fetch_token(self.token_endpoint,
headers=headers,
client_secret=self.client_secret,
- authorization_response=toolkit.request.url,
+ authorization_response=req_url,
verify=self.verify_https)
except requests.exceptions.SSLError as e:
# TODO search a better way to detect invalid certificates
regards
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
Hi, I want to use secure transport. I installed CKAN from Docker Compose. Please image this.
In this case, |
This is an issue with your CKAN setup; I would suggest look for help there. |
Very thanks for your project.
My execution environment is built with these versions.
On my execution environment, I got a error.
I tried to fix it.
I hope you like the following.
regards
The text was updated successfully, but these errors were encountered: