# Error while trying to add Paytm Oauth using discourse-oauth2-basic plugin

**URL:** <https://meta.discourse.org/t/error-while-trying-to-add-paytm-oauth-using-discourse-oauth2-basic-plugin/261407>\
**Category:** SSO\
**Tags:** oauth2\
**Created:** [April 12, 2023, 4:38am UTC](https://meta.discourse.org/t/error-while-trying-to-add-paytm-oauth-using-discourse-oauth2-basic-plugin/261407 "2023-04-12T04:38:04Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Shubham\_Dahibhate](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/shubham_dahibhate/32/302286_2.png) [@Shubham\_Dahibhate](https://meta.discourse.org/u/Shubham_Dahibhate)\
**Post date:** [April 12, 2023, 4:38am UTC](https://meta.discourse.org/t/error-while-trying-to-add-paytm-oauth-using-discourse-oauth2-basic-plugin/261407/1 "2023-04-12T04:38:05Z")

</div>

Hi Guys,  
I’m trying to add Paytm OAuth to my Discourse forum using the discourse-oauth2-basic plugin, but I’m having trouble getting it to work. I followed the instructions in the plugin’s readme file, but when I try to log in with Paytm, I get an error message saying “Authorization timed out, or you have switched browsers. Please try again.”  
I’m not sure why it isn’t working.

Any help would be greatly appreciated!

Below is the error I found in discourse log:

```plaintext
Error:
*Message*

*(oauth2_basic) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected*

*Backtrace*

*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:163:in `log'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:486:in `fail!'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-oauth2-1.7.3/lib/omniauth/strategies/oauth2.rb:87:in `callback_phase'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:238:in `callback_call'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:189:in `call!'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:169:in `call'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:192:in `call!'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:169:in `call'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:192:in `call!'*
*/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/omniauth-1.9.2/lib/omniauth/strategy.rb:169:in `call'*

*Env*

*HTTP HOSTS: devforum.paytm.in*

```

| hostname | devforum-app |
| --- | --- |
| process\_id | 148 |
| application\_version | 2d46824a87f2104b307abd76dbb2ec2b0f2df4a0 |
| HTTP\_HOST | devforum.paytm.in |
| REQUEST\_URI | /auth/oauth2\_basic/callback |
| REQUEST\_METHOD | GET |
| HTTP\_USER\_AGENT | Mozilla/5.0 (Macintosh; Intel Mac OS X 10\_15\_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36 |
| HTTP\_ACCEPT | text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,_/_;q=0.8,application/signed-exchange;v=b3;q=0.7 |
| HTTP\_REFERER | [https://paytm.com/](https://paytm.com/) |
| HTTP\_X\_FORWARDED\_FOR | 103.181.14.201, 136.226.233.15, 23.212.253.68, 104.124.54.30, 10.188.8.126 |
| HTTP\_X\_REAL\_IP | 10.188.8.126 |
| time | 9:50 am |

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/a/3/4a3435a39b52ce0e4d9635ac93de8c1eac5a8d05.jpeg)

---

_[View the full topic](https://meta.discourse.org/t/error-while-trying-to-add-paytm-oauth-using-discourse-oauth2-basic-plugin/261407)._
