horsebadorties
Contributor
Contributor

java sdk vcloudclient ssoLogin() w/ samlassertion

Jump to solution

Hello,

I am attempting to login using the java sdk's vCloudClient ssoLogin method.  I have configured a vcd organization to use a saml idp (openam) and can successfully login with an account from the idp to the organization via the web interface.  Now, I am attempting use the issued saml assertion to perform a login via the sdk using the samlAssertionXML String.  Appreciate any insight someone could provide.

The client receives a 500 error:

Aug 12, 2013 3:10:14 PM com.vmware.vcloud.sdk.RestUtil login

INFO: Login URL - https://vcd-url/api/sessions

Aug 12, 2013 3:10:14 PM com.vmware.vcloud.sdk.RestUtil login

INFO: Status Code - 500

Aug 12, 2013 3:10:14 PM com.vmware.vcloud.sdk.RestUtil login

INFO: Status - Server Error

Aug 12, 2013 3:10:14 PM com.vmware.vcloud.sdk.RestUtil login

INFO: Response -

Aug 12, 2013 3:10:14 PM com.vmware.vcloud.sdk.Response isExpected

INFO: Expected Status Code - 200

Aug 12, 2013 3:10:14 PM com.vmware.vcloud.sdk.Response isExpected

INFO: Actual Status Code - 500

and the server reports a nullpointer:

2013-08-12 16:00:23,414 | DEBUG| pool-jetty-63      | SignLoginFilter         | Error creating SAMLResponse element. |

java.lang.NullPointerException

at com.vmware.vcloud.security.web.SignLoginFilter.createSamlResponse(SignLoginFilter.java:275)
at com.vmware.vcloud.security.web.SignLoginFilter.authenticate(SignLoginFilter.java:200)
at com.vmware.vcloud.security.web.SignLoginFilter.doFilter(SignLoginFilter.java:449)
at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at com.vmware.vcloud.api.rest.versioning.AcceptHeaderFilter.doFilter(AcceptHeaderFilter.java:108)
at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at com.vmware.vcloud.security.web.ConversationFilter$1.run(ConversationFilter.java:39)
at com.vmware.vcloud.security.web.ConversationFilter$1.run(ConversationFilter.java:37)
at com.vmware.vcloud.common.persist.ConversationContextExecutor.execute(ConversationContextExecutor.java:67)
at com.vmware.vcloud.security.web.ConversationFilter.doFilter(ConversationFilter.java:45)
at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at com.vmware.vcloud.security.web.ThreadLocalCleanerFilter.doFilter(ThreadLocalCleanerFilter.java:65)
at com.vmware.vcloud.api.rest.diagnostics.RestApiDiagnosticsInterceptor.doFilter(RestApiDiagnosticsInterceptor.java:129)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77)
at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:181)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1331)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:477)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:521)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:449)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:910)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.eclipse.jetty.server.ssl.SslSocketConnector$SslConnectorEndPoint.run(SslSocketConnector.java:665)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Unknown Source)

I have a unit test w/ a manually captured saml assertion, where the assertion looks like the one in the attached saml-assertion.txt file.

The method simply takes in a string and attempts to login with a VcloudClient, see ssologin.txt.

0 Kudos
1 Solution

Accepted Solutions
horsebadorties
Contributor
Contributor

From the release notes:

Known Issues

 SSO login functionality throws 500 Internal Server Error if the SDK code is executed from a Linux environment. If you call the VcloudClient -> ssoLogin method, the SDK throws a 500 Internal Server Error if executed from a Linux environment. To avoid this behavior, upgrade the commons-code-1.4.jar to commons-codec-1.5.jar/commons-codec-1.6.jar.

Updating commons-codec resolved the 500 error; on to the next one!

View solution in original post

0 Kudos
3 Replies
IamTHEvilONE
Immortal
Immortal

If this is specific to the Java SDK, there is a forum specifically for it here: https://communities.vmware.com/community/vmtn/developer/forums/vcloudsdkjava

0 Kudos
horsebadorties
Contributor
Contributor

Thank you.  I posted a reference back from java sdk vcloudclient ssoLogin() w/ samlassertion

0 Kudos
horsebadorties
Contributor
Contributor

From the release notes:

Known Issues

 SSO login functionality throws 500 Internal Server Error if the SDK code is executed from a Linux environment. If you call the VcloudClient -> ssoLogin method, the SDK throws a 500 Internal Server Error if executed from a Linux environment. To avoid this behavior, upgrade the commons-code-1.4.jar to commons-codec-1.5.jar/commons-codec-1.6.jar.

Updating commons-codec resolved the 500 error; on to the next one!

0 Kudos