added external authentication function.
minor changes to work with bifferent bamboo installations.