Use OIDC through REST API

Hi All,

I have setup OIDC and Keycloak, through browser I am able to integrate Discourse, OIDC and Keycloak properly
I want to use API for creating/reply posts on behalf of users. For this I want to get the token from keycloak and use it in discourse (Don’t want users login to discourse seperately). Any help what api should I call and how to achieve this ?

From UI I can see additional fields comes after login i.e CSRF token and cookie and the complete flow works fine. I want to acheive same but through API without any UI interference.

Any leads will be appreciated.

Thank you

Just use a global token that works for any user. You can retrieve user tokens only once.

1 Like