# OAuth2-Benutzer-Verknüpfung innerhalb von Discourse

**URL:** <https://meta.discourse.org/t/0auth2-user-linking-within-discourse/127618>\
**Category:** SSO\
**Tags:** oauth2\
**Created:** [4. September 2019 um 16:53 UTC](https://meta.discourse.org/t/0auth2-user-linking-within-discourse/127618 "2019-09-04T16:53:25Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [30. September 2019 um 21:37 UTC](https://meta.discourse.org/t/0auth2-user-linking-within-discourse/127618/14 "2019-09-30T21:37:59Z")

</div>

Verdammt, du hast mich 7-mal getaggt, während ich im Urlaub war…

Anstatt die Methode `PluginStore.set` zu verwenden, musst du ein neues `UserAssociatedAccount` erstellen, zum Beispiel so:

```ruby
UserAssociatedAccount.create!(provider_name: 'oauth2_basic', provider_uid: 'google-apps|tony.danza@aol.com', user_id: 7235)

```

---

_[View the full topic](https://meta.discourse.org/t/0auth2-user-linking-within-discourse/127618)._
