Add map to struct conversion. Impl authentication method.