Authorization functions

Partially completed the Authorizing functions.