wso2wso2-identity-server

WSO2 - Identity server 6.1.0 - Self registration - No internal crypto providers available error


When following the self registration tutorial under WSO2 documentation website, I am facing an error when calling the self registration API.

The error is:

Caused by: org.wso2.carbon.user.core.UserStoreException: Error while encrypting the Credential for User Name XXXX
at org.wso2.carbon.user.mgt.workflow.userstore.UserStoreActionListener.doPreAddUser(UserStoreActionListener.java:125)
at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addUser(AbstractUserStoreManager.java:4913)
... 68 more
Caused by: org.wso2.carbon.identity.workflow.mgt.exception.WorkflowException: Error while 
encrypting the Credential for User Name XXXX
at org.wso2.carbon.user.mgt.workflow.userstore.AddUserWFRequestHandler.startAddUserFlow(AddUserWFRequestHandler.java:121)
at org.wso2.carbon.user.mgt.workflow.userstore.UserStoreActionListener.doPreAddUser(UserStoreActionListener.java:119)
... 69 more
 Caused by: org.wso2.carbon.core.util.CryptoException: An error occurred while encrypting data.
at org.wso2.carbon.core.util.CryptoUtil.encrypt(CryptoUtil.java:146)
at org.wso2.carbon.core.util.CryptoUtil.encrypt(CryptoUtil.java:160)
at org.wso2.carbon.core.util.CryptoUtil.encryptAndBase64Encode(CryptoUtil.java:242)
at 
org.wso2.carbon.user.mgt.workflow.userstore.AddUserWFRequestHandler.startAddUserFlow(AddUserWFRequestHandler.java:119)
... 70 more
Caused by: org.wso2.carbon.crypto.api.CryptoException: No internal crypto providers 
available. Correctly register a service implementation of 'interface 
org.wso2.carbon.crypto.api.InternalCryptoProvider' as an OSGi service
at 
 org.wso2.carbon.crypto.impl.DefaultCryptoService.encrypt(DefaultCryptoService.java:539)
at org.wso2.carbon.core.util.CryptoUtil.encrypt(CryptoUtil.java:144)
... 73 more

How to fix it and what is an OSGi? i tried to add a secret key to deployment.toml but it did not solve the issue.


Solution

  • Solution: add to deployment.toml the following (same as the configured details under carbon.xml but do not put the filepath of jks file only its name.

    [keystore.internal]
    file_name = "wso2carbon.jks"
    type = "JKS"
    password = "wso2carbon"
    alias = "wso2carbon"
    key_password = "wso2carbon"