OAUTH flow to Integrate the discourse community account with the third party CRM tool where it can create tickets of community

AI-generated summary

kekafel wants to integrate Discourse community accounts with a third-party CRM tool using the OAUTH flow. The desired process involves:

  1. Users adding their Discourse account to the tool using their login ID and password.
  2. Discourse sending an auth code to a callback URL.
  3. Exchanging the auth code for an access token and refresh token to fetch community data and create tickets.

thoka suggested following the Discourse documentation on using Discourse as an identity provider and creating an API key. However, kekafel found that these methods do not fulfill the OAUTH flow requirements, as they do not provide tokens after completing the steps. kekafel is looking for documentation to achieve the OAUTH flow, which involves redirecting users to the Discourse OAUTH page, granting permissions, and receiving a token at a callback URL.

I want to integrate discourse Account with the CRM tool that I have where what
I want is as follows :-

  1. User can add their Discourse community account in my tool using his discourse loginId and password .
  2. Discourse should send the auth code to the callback Url that I will send to it
  3. Using which i want to get (Access token & refresh token ) from discourse That I will later use to call discourse APIS to fetch community data and create tickets with them.

I would work through this documentation:

Thanks @thoka
Create and configure API key :
Working with this docs is like generating API key from the discourse ( community account ) and then adding that API key manually at my web app which i will later use for api call.

I will explain my use case little more detailed :-
User can click on button [add Discourse]
it will redirect him to the discourse OAUTH page where user will grant me all permissions
after click on accept the dicourse will return the token to my callbackUrl
which i Will store and use for further API CALL

Is there any documentation that can help me achieve the same.