Implementation and tests for CreateLogin