This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How do I add authorization on read and write characteristics?

I have a created a custom service and a custom characteristics. The characteristics has both read and write properties.  Now I want to authorize the read and write opearations . I have already aded these lines in my code. 

ble_attr_md.rd_auth = 1;
ble_attr_md.wr_auth = 1;

But I am unable to handle the events for BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST. Please let me know how to handle these events and how and where to set the passwords. I am usig SDK_v16.0 and nRF52832 DK.
Please provide any code example if u have any.
Thanks ..!!