Cognito OAuth authentication always redirect to localhost:8000....
See original GitHub issueHello there,
I have deployed Scoold in a Kubernetes cluster with the Chart Helm reference of this project. I am now trying to configure the OAuth authentication with Cognito! I have been able to configure about 90% of the authentication flow through Paraio backend. I’ve been stuck for 2 days now on the same problem that when the user is correctly authenticated through Paraio backend, it sends a response at:
https://{my_scoold_domain}/signin/success?jwt=id
After, getting this reponse, I am instanly redirect to
localhost:8000
which is Scoold local address running in pod. The element that allows me to affirm that there is a redirection error at the end of the flow is that when I manually go back to my scoold home page (https://{my_scoold_domain}), I can see that I am logged in and the session cookie have been correctly set. So If I was able to force a redirection to my scoold home page, the authentication flow would be 100% implemented with Cognito.
Here is my application.conf that I’m passing trough the Chart Helm:
applicationConf: |
para.env = production
para.endpoint = "https://paraio.com"
para.app_name = "{app_name}"
para.access_key = "{access_key }"
para.secret_key = "{secret_key }"
para.password_auth_enabled = false
para.security.signin_success = "https://{my_scoold_domain}/signin/success?jwt=id" #currently not working on my chart deployment (need manual config in paraio console)
para.security.signin_failure = "https://{my_scoold_domain}/signin/success?jwt=id" #currently not working on my chart deployment (need manual config in paraio console)
para.oa2_app_id = "{oa2_app_id }"
para.oa2_secret = "{oa2_secret }"
para.security.oauth.authz_url = "https://{cognito_domain}.auth.ca-central-1.amazoncognito.com/login"
para.security.oauth.token_url = "https://{cognito_domain}.auth.ca-central-1.amazoncognito.com/oauth2/token"
para.security.oauth.profile_url = "https://{cognito_domain}.auth.ca-central-1.amazoncognito.com/oauth2/userInfo"
para.security.oauth.provider = "Continue with Cognito"
I have checked all OAuth issues that might have been helpful, but none has any concrete solution to this problem 😞 . So a small summary of the problem and how I’ve got it:
- Click on the Cognito authentication button
- Been redirect to:
https://{cognito_domain}.auth.ca-central-1.amazoncognito.com/login?response_type=code&client_id={client_id}&scope=&state={para_access_key}&redirect_uri=https://paraio.com/oauth2_auth
- Authenticating with the right identity provider
- Identity provider return the user information
- Redirection call to Paraio backend for getting jwt token
https://paraio.com/oauth2_auth?code={user_id_code}&state={para_access_key}
- Redirection call to my scoold app with jwt token:
https://{my_scoold_domain}/signin/success?jwt={jwt_valid_token}
- The moment when the http call at step 6 is completed, we get another redirection to localhost:8000 and the web page is not found…
Thank you for your time
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
Also worth noting is that since Scoold 1.49.0 all
para.*
configuration properties in Scoold have been deprecated. Please change the prefix of all properties frompara.
toscoold.
if you are running Scoold v1.49+. This is to prevent confusion in people configuring both Para and Scoold at the same time.Hi there! Hopefully this is easy to fix - just add
para.host_url = "https://{my_scoold_domain}"
and remove these two lines:Restart the pod and you should be done.