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

Update our Saml authentication code to use IDP 3 flows #33

Closed
yurem opened this issue Sep 4, 2017 · 11 comments
Closed

Update our Saml authentication code to use IDP 3 flows #33

yurem opened this issue Sep 4, 2017 · 11 comments

Comments

@yurem
Copy link
Contributor

yurem commented Sep 4, 2017

In our IDP3 we uses old IDP2 filters to do Saml authentication. But IDP3 has flow specially developed for this. There are case when our old integration led to errors. Person in some circumstances not getting login form because we are not initialization flow properly.

@dmogn
Copy link
Contributor

dmogn commented Sep 4, 2017

saml-test-sp, Shib IDP v3.3 in gluu-sever v3.1.0:

2017-09-02 06:07:23,580 - INFO [net.shibboleth.idp.authn.impl.RemoteUserAuthServlet:193] - RemoteUserAuthServlet will process REMOTE_USER, along with attributes [] and headers []
2017-09-02 06:10:31,179 - INFO [net.shibboleth.idp.authn.impl.FilterFlowsByForcedAuthn:82] - Profile Action FilterFlowsByForcedAuthn: No potential authentication flows remain after filtering
2017-09-02 06:10:31,182 - INFO [net.shibboleth.idp.authn.impl.SelectAuthenticationFlow:271] - Profile Action SelectAuthenticationFlow: No potential flows left to choose from, authentication failed
2017-09-02 06:10:31,376 - INFO [Shibboleth-Audit.SSO:241] - 20170902T061031Z|urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST|a5c9f425e80e553g38c293cc8f0be0j|https://ce.gluu.info:18443/saml-test-sp/saml/metadata|http://shibboleth.net/ns/profiles/saml2/sso/browser|https://ce.gluu.info/idp/shibboleth|urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST|_d95aa586b0f9f98dc51a23affb5640f8||||||

I've reproduced the problem in gluu-server v3.0.2 with default installation settings.

@sahilIT2020
Copy link

sahilIT2020 commented Sep 5, 2017

Error when trying to SSO with Google
https://IDP_GLUU/idp/Authn/RemoteUser?conversation=e1s1

HTTP ERROR 500

Problem accessing /idp/Authn/RemoteUser. Reason:

Server Error

Caused by:

java.lang.NoClassDefFoundError: edu/internet2/middleware/shibboleth/idp/util/HttpServletHelper
at org.gluu.oxauth.client.authentication.AuthenticationFilter.getOAuthRedirectUrl(AuthenticationFilter.java:162)
at org.gluu.oxauth.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:99)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at net.shibboleth.idp.log.SLF4JMDCServletFilter.doFilter(SLF4JMDCServletFilter.java:72)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at net.shibboleth.utilities.java.support.net.RequestResponseContextFilter.doFilter(RequestResponseContextFilter.java:61)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)

2017_09_05.stderrout.log
jetty-9.3/temp/jetty-localhost-8086-idp.war-_idp-any-2820633897798931430.dir/webapp/,AVAILABLE}{/idp.war}
2017-09-05 00:43:09.092:INFO:oejs.AbstractConnector:main: Started ServerConnector@5c156cfe{HTTP/1.1,[http/1.1]}{localhost:8086}
2017-09-05 00:43:09.092:INFO:oejs.Server:main: Started @10987ms
2017-09-05 02:36:24.697:WARN:oejs.ServletHandler:qtp274064559-18: Error for /idp/Authn/RemoteUser
java.lang.NoClassDefFoundError: edu/internet2/middleware/shibboleth/idp/util/HttpServletHelper
at org.gluu.oxauth.client.authentication.AuthenticationFilter.getOAuthRedirectUrl(AuthenticationFilter.java:162)
at org.gluu.oxauth.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:99)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at net.shibboleth.idp.log.SLF4JMDCServletFilter.doFilter(SLF4JMDCServletFilter.java:72)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at net.shibboleth.utilities.java.support.net.RequestResponseContextFilter.doFilter(RequestResponseContextFilter.java:61)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1759)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1751)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)

@dmogn
Copy link
Contributor

dmogn commented Sep 11, 2017

"No potential flows left to choose from, authentication failed" - Fixed.
"HTTP ERROR 500" - Fixed.

@dmogn dmogn closed this as completed Sep 11, 2017
@dmogn dmogn reopened this Sep 11, 2017
@dmogn
Copy link
Contributor

dmogn commented Sep 11, 2017

identity_provider_error

@dmogn
Copy link
Contributor

dmogn commented Sep 15, 2017

I found the problem. oxAuth should callback with CONVERSATION_KEY, GET parаmeter "conversation".

https://ce.gluu.info/idp/profile/SAML2/POST/SSO?execution=e1s1
https://ce.gluu.info/idp/Authn/RemoteUser?conversation=e1s1

IDP v.3.3.1 tracks flow with this key. Shib IDP does not add this CONVERSATION_KEY to session, by some reasons, just inserts to redirection URLs.

@dmogn dmogn modified the milestones: 3.1.0, 3.2.0 Sep 15, 2017
@dmogn
Copy link
Contributor

dmogn commented Sep 15, 2017

#10 related issue.

@dmogn
Copy link
Contributor

dmogn commented Sep 26, 2017

CONVERSATION_KEY - fixed.

@dmogn
Copy link
Contributor

dmogn commented Sep 27, 2017

Alex Samuseu: That error is gone, but it still fails, now resulting in Authn failed SAML response to SP all the time

    <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Requester">
        <saml2p:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:AuthnFailed"/>
    </saml2p:StatusCode>

@dmogn
Copy link
Contributor

dmogn commented Sep 28, 2017

AuthnFailed - fixed.
TODO:
1 - get right username from oxauth-client API
2 - check attribute releasing

@dmogn
Copy link
Contributor

dmogn commented Sep 28, 2017

attribute - OK

@dmogn
Copy link
Contributor

dmogn commented Sep 28, 2017

All OK.

@dmogn dmogn closed this as completed Sep 28, 2017
@dmogn dmogn modified the milestones: 3.2.0, 3.1.1 Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants