GluuFederation / gluu-passport

Gluu interface to Passport.js to support social login and inbound identity.
Apache License 2.0
6 stars 16 forks source link

Passport social login failed. #486

Closed MohitMaliFtechiz closed 1 year ago

MohitMaliFtechiz commented 1 year ago

Describe the issue

Passport social login failed.

Step to replicate

a) Create google provider under passport . b) select type as oauth, stragegy as passport-google-oauth2 and mapping as google. b) Provide crediential secret and key. c) Add provider. d) Set authentication as passport-social. e) try to login via external provider

Expected Result

Its must redirect to external provider for authenticaiton.

Actual Result.

The page reloads and stays on login page.

Screenshot

Envrionment.

Ubuntu 22.04 Gluu Server 4.4.2+ opendj

Logs

Passport logs

  2022-10-17 07:06:31.815+0000 [INFO]     Loggers reconfigured
2022-10-17 07:06:35.577+0000 [ERROR]    Error: Received unexpected HTTP status code of 500
2022-10-17 07:06:35.579+0000 [WARN]     An attempt to get configuration data will be tried again soon
2022-10-17 07:07:35.571+0000 [ERROR]    Error: Received unexpected HTTP status code of 500
2022-10-17 07:07:35.573+0000 [WARN]     An attempt to get configuration data will be tried again soon
2022-10-17 07:08:35.850+0000 [ERROR]    Error: Received unexpected HTTP status code of 500
2022-10-17 07:08:35.851+0000 [WARN]     An attempt to get configuration data will be tried again soon
2022-10-17 07:09:35.796+0000 [ERROR]    Error: Received unexpected HTTP status code of 500
2022-10-17 07:09:35.799+0000 [WARN]     An attempt to get configuration data will be tried again soon

oxauth-script logs

2022-10-17 07:06:44,486 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:209) - Executing python 'authenticate' authenticator method
2022-10-17 07:06:44,486 INFO  [qtp952562199-18] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. authenticate for step 1 called
2022-10-17 07:06:44,489 INFO  [qtp952562199-18] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. authenticate for step 1. Retrying step 1
2022-10-17 07:06:44,489 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:307) - Executing python 'getApiVersion' authenticator method
2022-10-17 07:06:44,490 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:223) - Executing python 'getNextStep' authenticator method
2022-10-17 07:06:44,529 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:279) - Executing python 'getExtraParametersForStep' authenticator method
2022-10-17 07:06:44,529 INFO  [qtp952562199-18] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getExtraParametersForStep called
2022-10-17 07:06:44,530 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:195) - Executing python 'getCountAuthenticationSteps' authenticator method
2022-10-17 07:06:44,531 INFO  [qtp952562199-18] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getCountAuthenticationSteps called
2022-10-17 07:06:44,532 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:293) - Executing python 'getPageForStep' authenticator method
2022-10-17 07:06:44,532 INFO  [qtp952562199-18] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getPageForStep called
2022-10-17 07:06:44,532 TRACE [qtp952562199-18] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:279) - Executing python 'getExtraParametersForStep' authenticator method
2022-10-17 07:06:44,532 INFO  [qtp952562199-18] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getExtraParametersForStep called
2022-10-17 07:06:44,837 TRACE [qtp952562199-14] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:400) - Validating acr_values: 'passport_social'
2022-10-17 07:06:44,837 DEBUG [qtp952562199-14] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:167) - Executing python 'isValidAuthenticationMethod' authenticator method
2022-10-17 07:06:44,837 TRACE [qtp952562199-14] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:265) - Executing python 'prepareForStep' authenticator method
2022-10-17 07:06:44,838 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. prepareForStep called 1
2022-10-17 07:06:44,839 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. parseAllProviders. Adding providers
2022-10-17 07:06:44,849 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. parseProviderConfigs. Configured providers:
2022-10-17 07:06:44,849 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) -  {u'google': {'requestForEmail': False, 'displayName': u'Google', 'emailLinkingSafe': False, 'type': u'oauth', 'logo_img': None, 'saml': False}}
2022-10-17 07:06:44,855 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getPassportRedirectUrl. Obtaining token from passport at https://test442.gluu.org/passport/token
2022-10-17 07:06:44,888 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getPassportRedirectUrl. Response was 503
2022-10-17 07:06:44,888 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getPassportRedirectUrl. Error building redirect URL: 
2022-10-17 07:06:44,889 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) -  expected string or buffer, but got <type 'NoneType'>
2022-10-17 07:06:44,889 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. prepareForStep. A page to manually select an identity provider will be shown
2022-10-17 07:06:44,889 TRACE [qtp952562199-14] [org.gluu.oxauth.service.external.ExternalAuthenticationService] (ExternalAuthenticationService.java:279) - Executing python 'getExtraParametersForStep' authenticator method
2022-10-17 07:06:44,889 INFO  [qtp952562199-14] [org.gluu.service.PythonService$PythonLoggerOutputStream] (PythonService.java:243) - Passport. getExtraParametersForStep called
2022-10-17 07:06:45,537 TRACE [oxAuthScheduler_Worker-5] [org.gluu.service.custom.script.CustomScriptManager] (CustomScriptManager.java:134) - Last finished time '2022-10-17T07:06:45.537+0000'
2022-10-17 07:07:15,514 TRACE [oxAuthScheduler_Worker-3] [org.gluu.service.custom.script.CustomScriptManager] (CustomScriptManager.java:134) - Last finished time '2022-10-17T07:07:15.514+0000'
2022-10-17 07:07:45,539 TRACE [oxAuthScheduler_Worker-5] [org.gluu.service.custom.script.CustomScriptManager] (CustomScriptManager.java:134) - Last finished time '2022-10-17T07:07:45.539+0000'
2022-10-17 07:08:15,519 TRACE [oxAuthScheduler_Worker-3] [org.gluu.service.custom.script.CustomScriptManager] (CustomScriptManager.java:134) - Last finished time '2022-10-17T07:08:15.519+0000'
kdhttps commented 1 year ago

@MohitMaliFtechiz could you please send passport logs with DEBUG level? also send oxtrust logs. Look like oxtrust is not up

MohitMaliFtechiz commented 1 year ago

oxtrust.log here is oxtrust log, passort log file shows only above log only.

kdhttps commented 1 year ago

unable to reproduce on a fresh installation(as we discussed on chat). I am closing for now. Feel free to open it once you start facing issues again.