# User (patron) getting authorization error message

**URL:** <https://meta.discourse.org/t/user-patron-getting-authorization-error-message/99578>\
**Category:** Product Support\
**Tags:** patreon\
**Created:** [15 oktober 2018 om 21:02 UTC](https://meta.discourse.org/t/user-patron-getting-authorization-error-message/99578 "2018-10-15T21:02:09Z")\
**Posts on this page:** 1\
**Showing post:** 47

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [22 februari 2019 om 10:40 UTC](https://meta.discourse.org/t/user-patron-getting-authorization-error-message/99578/47 "2019-02-22T10:40:03Z")

</div>

Here’s a brief outline of how the “state” token is used. It’s part of the OAuth2 specification, so is used for all Discourse’s social login methods, including Patreon, OIDC and OAuth2.

1. User clicks “login” on Discourse

2. Discourse generates a random string (a “state token”), and stores it against the user’s browser session

3. Discourse redirects the user to the auth provider, passing along a copy of the state token

4. User logs in, and is redirected back to Discourse. The provider passes back the state token

5. Discourse checks that the received state token matches the one it stored against the user’s browser session earlier. If they do not match, this is considered an CSRF attack.

So, the most likely way this can break in practice, is if the user starts/ends the process in a different browser session. On a desktop this is pretty much impossible, but mobile operating systems tend to have different browser sessions for PWAs vs. browsers vs. native apps, which could be causing this issue.

> [@simonv3](#):
>
> Only mobile users see this.

Do you know whether these users are using the Discourse app, or an ‘installed’ PWA?

---

_[View the full topic](https://meta.discourse.org/t/user-patron-getting-authorization-error-message/99578)._
