implemented the final version of authorize for providers