Add an example of how to use the authorization hook

I wonder if it is too complex.