Hi Devs,

I got errors when running the Checking the Authorization of WebApp Requests
sample [1].

[1].
https://docs.wso2.com/display/AS521/Checking+the+Authorization+of+WebApp+Requests

When I try to access protected.jsp I got the following error in AS.

java.lang.NullPointerException
>     at
> org.wso2.carbon.identity.entitlement.filter.EntitlementFilter.doFilter(EntitlementFilter.java:187)
>     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
>     at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
>     at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
>     at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
>     at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
>     at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
>     at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
>     at
> org.wso2.carbon.statistics.webapp.RequestIntercepterValve.invoke(RequestIntercepterValve.java:43)
>     at
> org.wso2.carbon.bam.webapp.stat.publisher.WebAppStatisticPublisherValve.invoke(WebAppStatisticPublisherValve.java:104)
>     at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.continueInvocation(CompositeValve.java:178)
>     at
> org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve$1.invoke(CarbonTomcatValve.java:47)
>     at
> org.wso2.carbon.webapp.mgt.TenantLazyLoaderValve.invoke(TenantLazyLoaderValve.java:56)
>     at
> org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer.invokeValves(TomcatValveContainer.java:47)
>     at
> org.wso2.carbon.tomcat.ext.valves.CompositeValve.invoke(CompositeValve.java:141)
>     at
> org.wso2.carbon.tomcat.ext.valves.CarbonStuckThreadDetectionValve.invoke(CarbonStuckThreadDetectionValve.java:156)
>     at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
>     at
> org.wso2.carbon.tomcat.ext.valves.CarbonContextCreatorValve.invoke(CarbonContextCreatorValve.java:52)
>     at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
>     at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
>     at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
>     at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
>     at
> org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1653)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>     at java.lang.Thread.run(Thread.java:662)
>


Seems like this error is getting when retrieving decision from XACML
Response.

When I enable debug logs in IS, still the XACML respone decision is
"NotApplicable". Server cannot find matching XACML policy. but policy is in
the IS and policy works find when I running it through try-it tool.

XACML request and response looks like follows

Request:

<Request *xlmns*="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"
> CombinedDecision="false" ReturnPolicyIdList="false">
>     <Attributes
> Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject">
>         <Attribute
> AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"
> IncludeInResult="false">
>             <AttributeValue DataType="
> http://www.w3.org/2001/XMLSchema#string";>admin</AttributeValue>
>         </Attribute>
>     </Attributes>
>     <Attributes
> Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action">
>         <Attribute
> AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"
> IncludeInResult="false">
>             <AttributeValue DataType="
> http://www.w3.org/2001/XMLSchema#string";>GET</AttributeValue>
>         </Attribute>
>     </Attributes>
>     <Attributes
> Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource">
>         <Attribute
> AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"
> IncludeInResult="false">
>             <AttributeValue DataType="
> http://www.w3.org/2001/XMLSchema#string
> ">/Entitlement_Sample_WebApp/protected.jsp</AttributeValue>
>         </Attribute>
>     </Attributes>
>     <Attributes
> Category="urn:oasis:names:tc:xacml:3.0:attribute-category:environment">
>         <Attribute
> AttributeId="urn:oasis:names:tc:xacml:1.0:environment:environment-id"
> IncludeInResult="false">
>             <AttributeValue DataType="
> http://www.w3.org/2001/XMLSchema#string";></AttributeValue>
>         </Attribute>
>     </Attributes>
> </Request>
>

Response:

<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17">
>     <Result>
>         <Decision>NotApplicable</Decision>
>         <Status>
>            <StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/>
>         </Status>
>     </Result>
> </Response>
>


What would be the cause for this ?

Thanks
-- 

Danesh Kuruppu
Software Engineer
WSO2 Inc,
Mobile: +94 (77) 1690552
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to