Custom Endpoint creation in OpenIdM 6.0 throwing “resource not found error”

This topic contains 1 voice and has 0 replies.

  • Author
    Posts
  • #22747
     Meiyappan 
    Participant

    Hi Everyone,

    We are using OpenIdM version 6.0. We are trying to create a custom endpoint.
    Below are the steps which were followed during the endpoint creation.

    conf/endpoint-sendResetPasswordEmail.json:

    {
    “context” : “endpoint/sendResetPasswordEmail”,
    “type” : “text/javascript”,
    “file” : “script/sendResetPasswordEmail.js”
    }

    script/sendResetPasswordEmail.js: (sendResetPasswordEmail.js is placed in both script folder. one under the <openIdM domain folder>/script .other under <openIdM domain folder>/bin/default/script)

    response = {};

    function sendEmail(addr) {
    var params = new Object();
    params.from = “openidm@example.com”;
    params.to = addr;
    params.subject = “Email test”;
    params.type = “text/html”;
    params.body = “<html><body>Congratulations</body></html>”;
    return openidm.action(“external/email”, “send”, params);
    }

    response = sendEmail(request.additionalParameters.email);
    response;

    Email settings are configured. In access.js, below configuration is performed.(trying to allow all the users as of now)

    {
    “pattern” : “endpoint/sendResetPasswordEmail”,
    “roles” : “*”,
    “methods” : “*”,
    “actions” : “*”
    }

    When the restendpoint is hit.
    curl -X GET -H “X-OpenIDM-Username: openidm-admin” -H “X-OpenIDM-Password: openidm-admin” http://openidm.example.com:8080/openidm/endpoint/sendResetPasswordEmail?email=bob@example.com

    we are getting the Resource not found error.
    code”:404,”reason”:”Not Found”,”message”:”Resource ‘endpoint/sendResetPasswordEmail’ not found”}

    Any pointer would be helpful.
    Thanks in advance.

    Regards,
    Meiyappan

Viewing 1 post (of 1 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?