Hi Danushka,

This is a known bug and reported at [1]. A workaround would be to implement
both interfaces ("PostAuthenticationHandler" and "AuthorizationHandler")
and leave the method bodies coming from "AuthorizationHandler" empty.

[1] https://wso2.org/jira/browse/IDENTITY-5575

On Thu, Mar 16, 2017 at 5:59 PM, Danushka Fernando <[email protected]>
wrote:

> And further there is following code as well for get authorization handlers
>
> /**
>  * Gets the configured authorization handler at identity.xml
>  *
>  * @return Configured authorization handler
>  */
> public static AuthorizationHandler getAuthorizationHandler() {
>
>     AuthorizationHandler authorizationHandler = null;
>     Object obj = ConfigurationFacade.getInstance().getExtensions()
>             .get(FrameworkConstants.Config.QNAME_EXT_AUTHORIZATION_HANDLER);
>
>     if (obj instanceof AuthorizationHandler) {
>         authorizationHandler = (AuthorizationHandler) obj;
>     }
>     return authorizationHandler;
> }
>
>
> Thanks & Regards
> Danushka Fernando
> Senior Software Engineer
> WSO2 inc. http://wso2.com/
> Mobile : +94716332729 <+94%2071%20633%202729>
>
> On Thu, Mar 16, 2017 at 5:53 PM, Danushka Fernando <[email protected]>
> wrote:
>
>> Hi All
>>
>> In Framework utils I see following method.
>>
>> /**
>>  * Gets the configured post authentication handler at identity.xml
>>  *
>>  * @return Configured post authentication handler
>>  */
>> public static PostAuthenticationHandler getPostAuthenticationHandler() {
>>
>>     PostAuthenticationHandler postAuthenticationHandler = null;
>>     Object obj = ConfigurationFacade.getInstance().getExtensions()
>>             .get(FrameworkConstants.Config.QNAME_EXT_AUTHORIZATION_HANDLER);
>>
>>     if (obj instanceof PostAuthenticationHandler) {
>>         postAuthenticationHandler = (PostAuthenticationHandler) obj;
>>     } else {
>>         postAuthenticationHandler = 
>> DefaultPostAuthenticationHandler.getInstance();
>>     }
>>     return postAuthenticationHandler;
>> }
>>
>> But value of the constant "QNAME_EXT_AUTHORIZATION_HANDLER" is
>> AuthorizationHandler not PostAuthenticationHandler. And I see another
>> constant right below that "QNAME_EXT_POST_AUTHENTICATION_HANDLER" which
>> is not used. And the the default configuration have an element under
>> AuthorizationHandler tag which is extended from AuthorizationHandler
>> interface. Is this a bug?
>>
>> Thanks & Regards
>> Danushka Fernando
>> Senior Software Engineer
>> WSO2 inc. http://wso2.com/
>> Mobile : +94716332729 <+94%2071%20633%202729>
>>
>
>


-- 
*Pulasthi Mahawithana*
Senior Software Engineer
WSO2 Inc., http://wso2.com/
Mobile: +94-71-5179022
Blog: https://medium.com/@pulasthi7/

<https://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to