Added authorization functionality.