Implemented up to authorisation code generation