Will look into this.

Thanks,
-Nirdesha

On Sat, Oct 25, 2014 at 7:04 AM, Shamika Ariyawansa <sham...@wso2.com>
wrote:

> Hi all,
>
> Writing custom authenticate handlers as described in [1] seems to be no
> longer valid. With APIM 1.7.0 on-wards we have to introduce custom
> authentication handlers by editing the template file located in
> <AM_HOME>/repository/resources/api_templates/velocity_template.xml.
>
> However when doing that we have to make sure that it skips the default 
> APIAuthenticationHandler
> too. Please see the following modified segment in that file which does
> this,
>
> <handlers xmlns="http://ws.apache.org/ns/synapse";> <handler
> class="org.wso2.carbon.apimgt.custom.authentication.handler.CustomAPIAuthenticationHandler"
> /> #foreach($handler in $handlers) #if(!($handler.className ==
> "org.wso2.carbon.apimgt.gateway.handlers.security.APIAuthenticationHandler"))
> <handler xmlns="http://ws.apache.org/ns/synapse";
> class="$handler.className"> #if($handler.hasProperties()) #set ($map =
> $handler.getProperties() ) #foreach($property in $map.entrySet()) <property
> name="$!property.key" value="$!property.value"/> #end #end </handler> #end
> #end </handlers>
>
> We have to do this as the handlers are passed from the code itself.
>
> Also please note that the package name of the custom implementation in [1]
> should be changed as it will conflict with org.wso2.carbon.apimgt.gateway 
> bundle
> which will lead to some class loading issues.
>
> Please correct me if am wrong on this.
>
> [1]
> https://docs.wso2.com/display/AM170/Writing+Custom+Authentication+Handlers
>
> Regards,
> --
> Shamika Ariyawansa
> Senior Software Engineer
> WSO2, Inc.; http://wso2.com
>
> LK -  +94 7639629 Ext 5999
> US - +1 408 754 7388 Ext 51732
> Mob:+ 94 772929486
>
> *twitter: **https://twitter.com/Amila_Shamika*
> <https://twitter.com/Amila_Shamika>
> *linked-in: *http://www.linkedin.com/pub/dir/Shamika/Ariyawansa
>
> *Lean . Enterprise . Middleware*
>



-- 

Thanks,

Nirdesha Munasinghe,
WSO2 Inc.
Web:http://wso2.com

Mobile: +94 776321920
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to