This is a task that you must create on your own. I've performed this previously on asp.net successfully.
Maybe the following guidelines may help you:
1) Create or use an existing table containing users by name and make sure they are same as the ones in AD. (Must match).
2) If not already, create another field containing in that same table the role name. (This is a one user to one role approach and role name must match role name in AD.).
3) In the configuration file you must add entries using the appropriate tag code with the role names you created on your table. Remember roles must match those in AD.
4) In the code you must use the logic that best fits your needs (There are some examples in the internet that work fine) to read the AD database in order to reach the user id and also the groups that it belong to and that are associated with the roles assigned to the user.
5) Once you gather the info you may compare it against the data in your users table to make the validation and determine what actions to be taken in your application.
6) The data in your table may need to be maintained or synchronized against the AD on regular basis. (Manually or Automatically).
Hope this help.