# Discourse\_api sync\_sso custom\_fields results in "custom.custom.\<field\>" in payload

**URL:** <https://meta.discourse.org/t/discourse-api-sync-sso-custom-fields-results-in-custom-custom-field-in-payload/140127>\
**Category:** Bug\
**Created:** [January 30, 2020, 12:18am UTC](https://meta.discourse.org/t/discourse-api-sync-sso-custom-fields-results-in-custom-custom-field-in-payload/140127 "2020-01-30T00:18:08Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![vkozyrev](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vkozyrev/32/167391_2.png) [@vkozyrev](https://meta.discourse.org/u/vkozyrev)\
**Post date:** [January 30, 2020, 12:18am UTC](https://meta.discourse.org/t/discourse-api-sync-sso-custom-fields-results-in-custom-custom-field-in-payload/140127/1 "2020-01-30T00:18:09Z")

</div>

[https://github.com/discourse/discourse\_api/pull/190](https://github.com/discourse/discourse_api/pull/190)

`DiscourseApi::SingleSignOn` expects custom attributes to be assigned like

```plaintext
sso.custom_fields['field_1'] = 'value'

# which results in `custom.field_1` key in payload

```

`DiscourseApi::API::SSO.sync_sso()` expects params to have

```plaintext
{ 'custom.field_1' => 'value` }

```

But it passes in the `custom.` prefix to `sso.custom_fields`  
This results in the payload to having

```plaintext
custom.custom.field_1

```

Also added some test overkill for `sync_sso`

---

_[View the full topic](https://meta.discourse.org/t/discourse-api-sync-sso-custom-fields-results-in-custom-custom-field-in-payload/140127)._
