This can be a complex subject.
I learnt how to do it by watching some interactive tutorials by Mark Fletcher. These are for Security Assist version 1 and I'm assuming you are on V2 but the principle is basically the same.
As well as the tutorials there is also a pdf download you can read.
Follow this link and then click on Archived Documentation on the right. Towards the bottom there is a subject of User Level Authentication. Just follow the videos in order and it should put you in the correct direction. Or read the PDF doc.