20140827 give a more better solution for rest api auth