Custom rest secure controller

Hi all. We have created custom controller protected by oauth2 and defined the request path like this /rest/rapi/test_rapi.

When doing this do we need to define custom Custom Authentication to custom controller or not ? .

And how to pass the header informations and security credentials to the custom controller by rest client such as postman.

Thank you very much .

1 Like

Hi,

If you created your controller following https://doc.cuba-platform.com/manual-6.8/rest_api_v2_custom_controllers.html manual then there is no need to implement custom authentication. Simply pass OAuth2 token to the rest-api as described here: https://doc.cuba-platform.com/manual-6.8/rest_api_v2_ex_get_entities_list.html

An OAuth token must be put in the Authorization header with the Bearer type:

Authorization: Bearer 29bc6b45-83cd-4050-8c7a-2a8a60adf251

Get OAuth2 token with Postman (do not forget Headers)

get-oauth-token

get-headers

Then call your custom controller (from doc example https://doc.cuba-platform.com/manual-6.8/rest_api_v2_custom_controllers.html):

api-call

A post was split to a new topic: REST authentication password hashes