Authorization scripts.

Broken down to be more modular.