Trouble configuring oauth2 with mastodon


(Amit Ncert) #1

I am just trying to integrate my oauth2 provider i.e(mastodon) for login at my discourse because all my user’s reside in mastodon. I installed oauth2 plugin in my discourse and then provide following parameters in it.
Client ID for custom OAuth2
Client Secret for custom OAuth2
Authorization URL for OAuth2
Token URL for OAuth2.
After passing above parameters when I am trying to login with my Mastodon Credentials it giving me error saying that ““Sorry, there was an error authorizing your account. Perhaps you did not approve authorization? “”.
When I checked in the logs I am getting following error::
“” (oauth2_basic) Authentication failure! invalid_credentials: OAuth2::Error,””
Though my credentials are valid I am getting that error don’t know why?
I am getting following url after entering my oauth(mastodon) credentials in disocurse:::
““Network””

I am attaching screenshot of the credentials I used in the oauth2 plugin in discourse.It would be very nice if anybody tell me the where I am doing mistake so that I can correct it and execute that thing. Screenshots include flow of “Login Procedure”.If you looked at “Authorize deny window.png”
It is showing 2 options Authorize and Deny . When I clicked on Authorize option “error” message pops up which you can see in “error.png” image.