User token in API Service

Hi! I have some table and I set roles permissions(dissable access for AuthenticatedUser and NotAuthenticatedUser) and enable owner policy, it’s something like in yours Backendless Security Webinar. I have wrote API service on Java using BackendlessSDK for Java/Android and when I made request in API Inspector I got always null “[]” as result even if I pass user-token param. But when I pass user-token not as header but as query param and then set it manualy using HeadersManager.getInstance().addHeader(HeadersManager.HeadersEnum.USER_TOKEN_KEY,token) I got correct results. So the question is how I can read user-token param in API service code?
Thanks in advance!

In your case you should directly set permissions to every user, becouse you disable access for AuthenticatedUser.
Each specific user inherit (by default) all roles from AuthenticatedUser.

Hi Oleh,

We’re in the process of releasing an update of our server, SDKs and code runner. The updated code runner will give you access to the user token value. Once you update Java CodeRunner (you will need version 3.0.11) , you will be able to do the following:

com.backendless.servercode.InvocationContext.getUserToken()

We will update our blog/twitter/facebook/download page on the website once the release is available

Regards,
Mark