-
Notifications
You must be signed in to change notification settings - Fork 19
feat(oauth): login with Google #18
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
base: master
Are you sure you want to change the base?
Conversation
|
@nscendoni - I tried to demonstrate how to login with OIDC using Google but I can't seem to get the user authenticated. With the attached changes I can trigger a login flow when accessing http://localhost:8080/content/oauth-demo/playlists.html , I get to confirm the authentication with Google but when the redirect is sent to http://localhost:8080/oauth-demo/playlists/j_security_check?state=...&code=... ( which loooks good to me ) I get the sling form authentication page. What am I doing wrong here? (please ignore the spotify references, it looks like they are not a conformat OIDC provider) |
|
I see these issues with configuration:
|
|
Thanks @nscendoni . I made the adjustment but have the same issue. Here are the debug auth logs I could gather When accessing the protected resource and getting redirected to google for login after getting redirected back from Google Does anything look suspicious to you? Also, I can't reliably get the redirect to Google when logging in, sometimes this gets redirected to the form login, maybe it's related. |
|
I've never seen the authentication requirement configured with: |
|
It's valid to add this requirement to any service. I would actually recommend not doing it on the Sling Authenticator because you don't have can overwrite this by trying to add multiple requirement. But the problem is that I was not adding the /content prefix ; for now I added both and I can trigger the login flow reliably Still need to figure out some later errors but I'm unblocked for now, thanks for your help. |
|
@nscendoni this is finally almost working, I see the user being created but I get this error I don't know what to make of Any ideas on how to troubleshoot? |
|
@nscendoni - added some breakpoints, I think this is where it goes wrong OidcAuthenticationHandler.authenticationSucceeded returns false and then https://github.com/apache/sling-org-apache-sling-auth-core/blob/8bb459f1677656529bf6940c643bd6c4f3f67664/src/main/java/org/apache/sling/auth/core/impl/SlingAuthenticator.java#L427-L433 is executed.
|
|
@nscendoni - I configured some more attributes to be synced but still no luck with the login flow. I can see some more properties set on the user node but that does not impact the overall success.
|
|
@nscendoni - as discussed, here is the issue you discovered - https://issues.apache.org/jira/browse/SLING-12926 |
Should be reverted once fixed
|
With a workaround this now works! I was confused becuase the user is considered logged in only for the paths handled by the OidcAuthenticationHandler. I added some debug information on the protected page and now I can see that the user is authenticated, just that when navigating to the parent page it's back to anonymous.
I can now look into more detail into the OIDC authentication handler to set up a proper sample, and it would be nice to have SLING-12926 for the next release. |
|
With the changes from apache/sling-org-apache-sling-auth-oauth-client#30 this now works with custom idp names. |



No description provided.