Saturday, November 9, 2013

Openam custom modules - use of redirect callback


<ModuleProperties moduleName="SampleAuth" version="1.0" >
    <Callbacks length="1" order="1" timeout="600" header="Redirecting" >
        <RedirectCallback method="get">
            <RedirectUrl>#Dummy url#</RedirectUrl>
            <RedirectStatusParam>#Dummy url#</RedirectStatusParam>
        </RedirectCallback>        
        <NameCallback isRequired="true">
            <Prompt>return parameter from redirected url</Prompt>
        </NameCallback>
    </Callbacks>
</ModuleProperties>



in your process method you will have this code returning 1 (which is order of  the callbacks tag which has RedirectCallback)





Map<String, String> redirectData = new HashMap<String, String>();
redirectData.put("param1", "123");
redirectData.put("param2", "abc");


RedirectCallback rc = new RedirectCallback(redirectUrl, redirectData, "POST");
super.replaceCallback(1, 0, rc); // 1 is order of callbacks tag. 0 is the first callback which is                //RedirectCallback





No comments:

Post a Comment