start of GH authorisation logic