jerome.dev
jerome.dev

Reputation: 31

Adding a mysql user store with custom schema to WSO2 Identity Server

Currently, trying to use WSO2 Identity Server to authenticate users from a mysql user store that I created with my own schema. However, whenever I add this user store as a secondary one in WSO2, the users do not appear on the management console.

And when I attempt to authenticate a user from that store I get the error message:

[2019-05-24 10:01:15,951] ERROR{org.wso2.carbon.identity.auth.service.handler.impl.BasicAuthenticationHandler} 
-  Error occurred while trying to authenticate,
Error when handling event : PRE_AUTHENTICATION

Upvotes: 0

Views: 370

Answers (2)

Gayan
Gayan

Reputation: 799

I you cannot migrate user store to wso2 schema as senthalan explained then you have two options to plug custom schema.

  1. Change SQL queries from Advanced option of secondary user store configuration

  2. Writing custom user store manager by extending necessary functions like doAuthenticate, doAddUser [1]

Error when handling event : PRE_AUTHENTICATION basically coming from below listener

org.wso2.carbon.identity.governance.listener.IdentityMgtEventListener in identity.xml while handling pre authenticate event. You can even disable it.

[1]https://github.com/GayanM/custom-user-store

Upvotes: 1

senthalan
senthalan

Reputation: 2416

The user stores of the WSO2 servers need to have the specific schema (the schema script located in the dbscripts folder). You need to import users using this from your existing schema or scim2 endpoints to programmably import users

Upvotes: 1

Related Questions