# האם תוסף oauth2-basic יכול להמיר טקסט ל-json?

**URL:** <https://meta.discourse.org/t/can-plugin-oauth2-basic-convert-text-to-json/237618>\
**Category:** SSO\
**Tags:** oauth2\
**Created:** [30 באוגוסט,‏ 2022,‏ 5:35pm UTC](https://meta.discourse.org/t/can-plugin-oauth2-basic-convert-text-to-json/237618 "2022-08-30T17:35:16Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![qinyj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/qinyj/32/204391_2.png) [@qinyj](https://meta.discourse.org/u/qinyj)\
**Post date:** [8 בספטמבר,‏ 2022,‏ 4:24pm UTC](https://meta.discourse.org/t/can-plugin-oauth2-basic-convert-text-to-json/237618/7 "2022-09-08T16:24:48Z")

</div>

Show Chinese compatriots a way forward. In the container ` /var/www/discourse/vendor/bundle/ruby/2.7.0/gems/oauth2-1.4.7/lib/oauth2/response.rb`, the following code exists:

```plaintext
    # Content type assignments for various potential HTTP content types.
    @@content_types = {
      'application/json' => :json,
      ………………
      'text/plain' => :text,
    }

```

Change it to the following:

```plaintext
'text/plain' => :json,

```

Of course, this should only be useful for WeChat, as only WeChat returns text.

---

_[View the full topic](https://meta.discourse.org/t/can-plugin-oauth2-basic-convert-text-to-json/237618)._
