added reauthorize funtionality, added sample and testcase for reauthorization