Saturday, February 11, 2017

ERR_PARTIAL_AUTHENTICATION_NOT_ALLOWED: Partial authentication not allowed for the current request. Login with your user name and password and try again.


Issue: ERR_PARTIAL_AUTHENTICATION_NOT_ALLOWED:

When accessing the REST API the, user getting below JSON response

{"errors":[{"errorParameters":"","errorCode":"CWXFR0222E","errorKey":"ERR_PARTIAL_AUTHENTICATION_NOT_ALLOWED","errorMessage":"CWXFR0222E: Partial authentication not allowed for the current request. Login with your user name and password and try again."}]}


Resolving the issue:
For the custom REST API that is accessible to all user types (Guest, Generic and Registered)

(a)    Go to the folder Rest/WebContent/WEB-INF/config/com.ibm.commerce.rest-ext
(b)   Create a new file wc-rest-security.xml under this folder.
(c)    Place the below entry into the file
<security>
<partialAuthentication enabled="true" resource=<REST URL> method="GET"/>

</security>

For e.g, if your custom REST API is as below

<security>
<partialAuthentication enabled="true" resource=”store/{storeId}/get_tax” method="GET"/>

</security>


No comments:

Post a Comment