Q:

WSO2 Identity server - keep getting "internal error - server connection terminated"

I am getting an "Internal error" when implementing SAML2.0 setup with WSO2 Identity server.
I am running the sample applications and the identity server plus the sample apps are running.
The pickup-dispatch application is running fine on the link http://127.0.0.1:8080/saml2-web-app-pickup-dispatch.com/ and after clicking login, it redirects me to the identity server login page (expected). 
I enter my credentials but on pressing login, it returns "internal error - server connection terminated" after telling me about redirection to the app as seen in the screenshots below.
A snippet from the error trace is HTTP ERROR 500
Problem accessing /saml2-web-app-pickup-dispatch.com/home.jsp. Reason: Server Error
Caused by: javax.servlet.ServletException: org.wso2.carbon.identity.sso.agent.exception.SSOAgentException: Signature validation failed for SAML2 Element
Complete error stack trace - https://gist.github.com/KalemaEdgar/ee9804df5f2786e30af8ad2bd3ccf0fc

A:

This is what finally worked for me on top of Piraveena's response.
Since it is a signature validation error, to fix it properly I needed to add the public key of the identity server (<is-home>/repository/resources/security/wso2carbon.jks) to the keystore in the saml2-web-app-pickup-dispatch.com app (<app-location-in-tomcat>/WEB-INF/classes/wso2carbon.jks)
But if you simply want to try out the sample, a quick workaround would be to replace the keystore in the sample app(<app-location-in-tomcat>/WEB-INF/classes/wso2carbon.jks) with the keystore of the WSO2 Identity Server (<is-home>/repository/resources/security/wso2carbon.jks)
I also encourage those using WSO2 Identity server to join this slack workspace iam4developers.slack.com

