Added auth formatting and tests