WSO2 identity server external JDBC store - wso2

I want to use a external JDBC store as default store instead of the default LDAP store. Followed the documentation in this link.
http://docs.wso2.org/wiki/display/IS400/Configuring+an+External+JDBC+User+Store
Getting the following exception Appreciate any help.
An unknown exception occurred while starting LDAP server.java.lang.NullPointerException: Name is null

You can configure WSO2 IS 4.0.0 with an external JDBC users store.The problem is due to an issue with the instructions in the documentation(1) as some configuration steps are missing there.I have created the jira [DOCUMENTATION-17] to track this doc issue.
Please follow below steps to connect IS 4.0.0 with external jdbc users-store.
1) Change the UserStoreManager class to JDBCUserStoreManager from user-mgt.xml [IS_Home/repository/conf] and add the related database connection property to it as mentioned in (1)
2) Add 'passwordHashMethod' propert within JDBCUserStoreManager and set the value to 'SHA' or 'PLAIN_TEXT' in {IS_HOME}/repository/conf/user-mgt.xml.
Eg: <Property name="passwordHashMethod">SHA</Property>
3) Set value of the 'MultiTenantRealmConfigBuilder' property to 'org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder' in {IS_HOME}/repository/conf/user-mgt.xml.
Eg: <Property name="MultiTenantRealmConfigBuilder">org.wso2.carbon.user.core.config.multitenancy.SimpleRealmConfigBuilder</Property>
4) Enable JDBCTenantManager in tenant-mgt.xml and comment out the config section for CommonHybridLDAPTenantManager.
Once you did above configurations,you'll able to configure WSO2 Identity Server to an external jdbc user store successfully.
(1) http://docs.wso2.org/wiki/display/IS400/Configuring+an+External+JDBC+User+Store

I was able to resolve this.
Start with a clean install of WSO2 IS 4.0.0 if possible.
Apart from following the directions given in the documentation to setup a JDBC datastore; you need to do the following :
Enable JDBCTenantManager in tenant-mgt.xml and comment out CommonHybridLDAPTenantManager2
Set the enable property to false for EmbeddedLDAP in embedded-ldap.xml

Related

How to fix and error cause by unknown mediator iso8583 in wso2 ESB

hi everyone i try to use iso8583 connector in WSO2 ESB, i already follow this link but still got an error even i copied all the source exactly the same like in this link https://ei.docs.wso2.com/en/latest/micro-integrator/references/connectors/ISO8583-connector/ISO8583-inbound-endpoint-example/ anyone can give me solutions about it ?
this is the error i always got when i run the project
Caused by: org.apache.synapse.SynapseException: Unknown mediator referenced by configuration element : {http://ws.apache.org/ns/synapse}iso8583
This error indicates that the ESB cannot find the connector during the runtime.
You can verify whether the connector is properly deployed if the connector name is visible in /repository/deployment/server/synapse-configs/default/imports. If the connector is not available you need to add the connector to the ESB runtime.
You need to download the connector from the store[1] and add it to the ESB through the management console under connectors --> Add.
You can also add the connector through a connector exporter project[2] if you are deploying services using a car application.
[1] https://store.wso2.com/store/assets/esbconnector/details/e4cf3fd5-445f-4317-beb6-09998906fb0d
[2] https://ei.docs.wso2.com/en/7.0.0/micro-integrator/develop/creating-artifacts/adding-connectors/

How to perform following changes in tomcat configuration in WSO2IS 5.9.0?

I am trying to make /oauth2/token API call from reactjs fronted and getting CORS error.
My friend asked the same question and got answer for the same also.
Please open the link for solution.
WSO2 IS returns CORS error when wrong credentials sent
But when I am trying to perform the same in WSO2IS 5.9.0 the configuration is getting overwritten to the default config.
How to perform this in 5.9.0 using deployment.toml file?
As I have mentioned in that earlier answer you need to add the given tomcat filter in the web.xml.j2 file in the path repository/resources/conf/templates/repository/conf/tomcat. The .j2 files will not get replaced by the deployment.toml at the server startup.

Access H2 Embedded Database for WSO2 products

I am using stream processor 4.3.0 and need to access the H2 Database for it which comes by default in WSO2 SP application.
Can some please help me here to access/browse the database.
Thanks
And need to access the H2 Database for it which comes by default in WSO2 SP application
For WSO2SP DB configuration stored in:
${carbon.home}/conf/worker/deploymment.yaml
${carbon.home}/conf/dashboard/deploymment.yaml
${carbon.home}/conf/..other module../deploymment.yaml
so you can check the database locations
by default check
${carbon.home}/wso2/worker/database
${carbon.home}/wso2/dashboard/database
${carbon.home}/wso2/..other module../database
You can use H2 Shell to access the databases
Please note the embedded H2 databases are not intended to be accessed from multiple processes concurrently, so stop the wso2sp first
please find the answer below.
Open the /repository/conf/carbon.xml file and paste the following configuration.
Do not uncomment the existing element. Just paste the following configuration below it.
<H2DatabaseConfiguration>
<property name="web"/>
<property name="webPort">8082</property>
<property name="webAllowOthers"/>
</H2DatabaseConfiguration>
3.Restart the WSO2 product and access the following URL via your browser: http://localhost:8082
Tip: If you are logged in to the management console, log out before connecting to the database.
4.Enter the following details and click Connect.
JDBC URL : jdbc:h2:[file path to /repository/database/WSO2CARBON_DB]
username : wso2carbon
password : wso2carbon

wso2 identity server with postgres database schema

Actually I want to setup wso2is 5.3.0 with the postgres schema for production environment, which I have configured as "jdbc:postgresql://localhost:5432/wso2?currentSchema=wso2pgschema" in the masterdatasources.xml file and able to install wso2is in the postgres schema but when I goes to the browser and tries to login its gives me error
[LOG]
[2017-05-14 19:15:59,023] ERROR {org.wso2.carbon.user.core.common.AbstractUserStoreManager} - Error occurred while accessing Java Security Manager Privilege Block
[2017-05-14 19:15:59,026] ERROR {org.wso2.carbon.core.services.authentication.AuthenticationAdmin} - System error while Authenticating/Authorizing User : Error when handling event : PRE_AUTHENTICATION
Is there a way we can install it database schema ?or we have to install it in the database public schema/keep installation with the inbuild h2 database for production.
Please Help.
Thanks
Pankaj
Yes, you can use a schema other than the public schema. Please refer the post here for the steps.
For the second part of the question, the default H2 database is not recommended for production systems.

WSO2 ESB (4.9.0) throw out SOAPProcessingException when connecting Salesforce through proxy server

I try to use WSO2 ESB at workplace where Proxy Server is available.
Set Proxy Server settings in axis2.xml,
Install certificate.
Initialize Salesforce connector(Salesforce certificate has been installed).
Test the API, run into an exception - SOAPProcessingException,
Really appreciate if someone can give ideas of solution.
First of all I have tried this type of a scenario using WSO2 ESB 4.9.0 and which was perfectly working fine. By looking at your error messages I can see that there was an Authentication failure, hence Sales Force end point returns some HTML error message. The ESB tries to build this HTML error message using the SOAP builder leading to this situation.
This could be due to some missing configuration in your setting. You may follow [1] to enable HTTP Proxy to Sales Force. Then to setup Sales Force [2] will be helpful.
Couple of thing I need to highlight here. Did you import the Salesforce certificate into the ESBs client trust store using the keytool import command. If not please go ahead and do so. Also is there a particular reason for you to use NHTTP transport here. Ideally we would use Passthrough transport to add the proxy host as given in [1].
If you still get the error after following the above steps please enable the wirelogs and post it here to investigate further. Follow these steps to enable wirelogs.
Open log4j.properties file from a text editor.
log4j.properties file is located in $ESB_HOME/repository/conf directory.
Un-comment the following entry.
log4j.logger.org.apache.synapse.transport.http.wire=DEBUG
Hope this helps you.
[1] https://docs.wso2.com/display/ESB470/Enabling+SSL+Tunneling+through+a+Proxy+Server
[2]https://docs.wso2.com/display/ESBCONNECTORS/Working+with+Salesforce+Connector+Operations