Custom Self Registration Stage in ForgeRock IDM 6.0

This topic contains 7 replies, has 3 voices, and was last updated by  Meiyappan 1 week, 6 days ago.

  • Author
    Posts
  • #22597
     Meiyappan 
    Participant

    Hi Everyone,

    We are using ForgeRock IDM (version 6.0). We Would like to know if there is any possibility to create Custom Self Registration Stage in ForgeRock IDM.
    For Example, during the user self registration, if OTP should be sent to the user and validated in ForgeRock IDM, can some one help by giving some pointers.

    Also, is there any possibility to send different Registration mail for different users based on role or based on some attributes?(i.e.) When Admin self Registers, he should get Registration Mail which should be different from other users.

    Thanks,
    Meiyappan

    #22598
     Hanns Nolan 
    Participant

    A good starting point should be my wiki page at https://wikis.forgerock.org/confluence/display/openidm/Selfservices+in+IDM6

    #22604
     Andrew Potter 
    Participant

    I wrote a blog on creating a custom self-service stage.
    See: http://yaunap.blogspot.com/2017/06/forgerock-self-service-custom-stage.html
    It’s for v5, but applies to v6 equally.

    #22714
     Meiyappan 
    Participant

    Thank you Andrew Potter & Hanns Nolan for the inputs.

    #22715
     Meiyappan 
    Participant

    We referred to the below blogs for custom stages.

    1. http://yaunap.blogspot.com/2017/06/forgerock-self-service-custom-stage.html
    2. http://yaunap.blogspot.com/2016/07/custom-stages-to-user-self-service_1.html

    We reused the MathProblemStageConfig class (2nd blog). We compiled the code for MathProblemStageConfig class. No compilation error was thrown.

    We placed the jar inside the /bundle folder of open idm folder.
    We modified the selfservice-registration.json as below

    stageConfigs”: [
    {
    “class” : “org.forgerock.selfservice.custom.MathProblemStageConfig”,
    “leftValue” : 12,
    “rightValue” : 4
    },

    When we restart the server or try clicking on the register link, following error is thrown.

    Cannot locate class ‘org.forgerock.selfservice.custom.MathProblemStageConfig’, problem: org.forgerock.selfservice.custom.MathProblemStageConfig not found by org.forgerock.openidm.selfservice

    Can anyone please let us know what else need to be done to load the class. Do we need to register the jar using any commands?

    Thanks in advance.

    Regards,
    Meiyappan

    • This reply was modified 1 week, 6 days ago by  Meiyappan.
    #22717
     Meiyappan 
    Participant

    Complete Exception:

    Aug 03, 2018 2:01:17 AM org.forgerock.openidm.selfservice.impl.SelfServiceFactory createInstance
    WARNING: Unable to instantiate or register service: registration
    java.lang.IllegalArgumentException: Unable to load class for {“class”:”org.forgerock.selfservice.custom.MathProblemStageConfig”,”leftValue”:12,”rightValue”:4} (through reference chain: org.forgerock.selfservice.core.config.ProcessInstanceConfig[“stageConfigs”]->java.util.ArrayList[1])
    at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3738)
    at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:3656)
    at org.forgerock.selfservice.json.JsonConfig.buildProcessInstanceConfig(JsonConfig.java:107)
    at org.forgerock.selfservice.json.JsonAnonymousProcessServiceBuilder.build(JsonAnonymousProcessServiceBuilder.java:137)
    at org.forgerock.openidm.selfservice.impl.SelfServiceProcessHandler.<init>(SelfServiceProcessHandler.java:136)
    at org.forgerock.openidm.selfservice.impl.SelfServiceFactory.createInstance(SelfServiceFactory.java:278)
    at org.forgerock.openidm.selfservice.impl.SelfServiceFactory.lambda$modified$1(SelfServiceFactory.java:162)
    at java.util.Optional.ifPresent(Optional.java:159)
    at org.forgerock.openidm.selfservice.impl.SelfServiceFactory.modified(SelfServiceFactory.java:159)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.felix.scr.impl.inject.BaseMethod.invokeMethod(BaseMethod.java:224)
    at org.apache.felix.scr.impl.inject.BaseMethod.access$500(BaseMethod.java:39)
    at org.apache.felix.scr.impl.inject.BaseMethod$Resolved.invoke(BaseMethod.java:617)
    at org.apache.felix.scr.impl.inject.BaseMethod.invoke(BaseMethod.java:501)
    at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:302)
    at org.apache.felix.scr.impl.inject.ActivateMethod.invoke(ActivateMethod.java:294)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod(SingleComponentManager.java:772)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:727)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:645)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:609)
    at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:426)
    at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:273)
    at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:2074)
    at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:2042)
    at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:141)
    at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:109)
    at java.lang.Thread.run(Thread.java:748)
    Caused by: com.fasterxml.jackson.databind.JsonMappingException: Unable to load class for {“class”:”org.forgerock.selfservice.custom.MathProblemStageConfig”,”leftValue”:12,”rightValue”:4} (through reference chain: org.forgerock.selfservice.core.config.ProcessInstanceConfig[“stageConfigs”]->java.util.ArrayList[1])
    at org.forgerock.selfservice.core.config.ClassNameFallbackPropertyTypeDeserializer._deserializeTypedUsingDefaultImpl(ClassNameFallbackPropertyTypeDeserializer.java:85)
    at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:105)
    at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:254)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:245)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:27)
    at com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)
    at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:3733)
    … 29 more
    Caused by: java.lang.IllegalArgumentException: Failed to parse type ‘org.forgerock.selfservice.custom.MathProblemStageConfig’ (remaining: ”): Cannot locate class ‘org.forgerock.selfservice.custom.MathProblemStageConfig’, problem: org.forgerock.selfservice.custom.MathProblemStageConfig not found by org.forgerock.openidm.selfservice [227]
    at com.fasterxml.jackson.databind.type.TypeParser._problem(TypeParser.java:91)
    at com.fasterxml.jackson.databind.type.TypeParser.findClass(TypeParser.java:85)
    at com.fasterxml.jackson.databind.type.TypeParser.parseType(TypeParser.java:47)
    at com.fasterxml.jackson.databind.type.TypeParser.parse(TypeParser.java:33)
    at com.fasterxml.jackson.databind.type.TypeFactory.constructFromCanonical(TypeFactory.java:534)
    at org.forgerock.selfservice.core.config.ClassNameFallbackPropertyTypeDeserializer._deserializeTypedUsingDefaultImpl(ClassNameFallbackPropertyTypeDeserializer.java:68)
    … 38 more

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

©2018 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?