Map custom User Fields

I need to write a discourse plugin to read the SSO parameters and save then in the user fields, or is that functionality already implemented?