Login with Mastodon Credentials on Discourse

I am trying to login with my mastodon credentials on my discourse on live discourse site. I made following configuration in my discourse and I am getting “redirect uri included is not valid”. Can anybody knows the solution?I installed oauth plugin in my discourse and providing client secret and id.I uploaded two screenshots. In one screenshot configuration of Mastodon client key and all is there which I done in my disocurse and in another screenshot the error is getting which I mentioned above.

Thank you for actually trying this! Can you post a full URL from the browser from the first screenshot?

““https://member.metastudio.org/oauth/authorize?client_id=6ae994bbf9612105602ee9171aeac093288e4f696be887e594b39676ba35&redirect_uri=https%3A%2F%2Fx.metastudio.org%2Fauth%2Foauth2_basic%2Fcallback&response_type=code&scope=read&state=189f5adaa3b1253beb9dd2e372b1c8dc6e1c1c2df45a97"””

This is full url

1 Like

There are other fields also present in that plugin but I am not getting url for those fields. I am attaching one screenshot which shows other fields.

I just want to know Is is really possible?? Cz if it’s not possible then I will not invest my time in it.

I haven’t tried personally. Maybe others?

Ok fine. I will try again and see what’s happen.

1 Like

I tried all things but it is not working

When I put “https://x.metastudio.org/auth/oauth2_basic/callback
" in my redirect uri in mastodon instance. Now I am getting following message when I am try to login in my discourse instance with mastodon credentials. First popup comes with the option of authorize and deny and when we clicked on “authorize” second message pops up which says that “Sorry, there was an error authorizing your account. Perhaps you did not approve authorization?”. I have attached screenshot of both pop ups.I am also sharing url which I am getting . Let me know if anybody knows something.

.
Following url I am getting in second window.
““Network”””

  1. On Mastodon: Create a Application

Application name: Discourse Login (you can change this name)
Application website:https://<YOUR_DISCOURSE>/auth/oauth2_basic/callback
Redirect URI: https://<YOUR_DISCOURSE>/auth/oauth2_basic/callback

  1. On Discourse: Install this plugin to enable OAuth2
    GitHub - discourse/discourse-oauth2-basic: A basic OAuth2 plugin for use with Discourse

  2. Setup OAuth2 Plugin on Discourse
    Go to /admin/site_settings/category/login and scroll down

oauth2 enabled: * :ballot_box_with_check:* Custom OAuth2 is enabled
oauth2 client id: Your Mastodon App Client key
oauth2 client secret: Your Mastodon App Client secret
oauth2 authorize url: https://<YOUR_MASTODON>/oauth/authorize
oauth2 token url: https://<YOUR_MASTODON>/oauth/token
oauth2 user json url: https://<YOUR_MASTODON>/api/v1/accounts/verify_credentials
oauth2 json user id path: id
oauth2 json username path: username
oauth2 json name path: display_name
oauth2 json avatar path: avatar

Please note:

  • Mastodon doesn’t expose user’s email, so your user need to input their email to create Discourse account

Related link: