souramoo / commentoplusplus

Commento with out of the box patches and updates to add useful features and fixes. Also with one-click deploy to Heroku so you can get up and running fast.
MIT License
389 stars 62 forks source link

Programmatically trigger SSO #102

Open Gardamuse opened 2 years ago

Gardamuse commented 2 years ago

How would one programmatically trigger SSO?

I have implemented Commento with SSO on my website. However, since users already have accounts on the website and can log in with their username/password (after which they are granted a JWT cookie), I would like to be able to automatically log users into Commento when they are logged in to the website (and ideally log them out of Commento when they log out of the website or are no longer logged in to the website).

Pull request #34 would be a step in the right direction, but not quite enough as users would not actually be logged in until they start to type a comment or press the Commento "Log In" button, after already signing into the website. They would also not be logged out of Commento when logging out from the website.

Gardamuse commented 2 years ago

I realized that for my use case, it was probably best to just implement my own comment system. This since I already have a full frontend, backend, database and user authorization set up already, and I might be looking at doing some custom hijinks with user profiles as well.

It might even be that programmatic SSO as I was asking for is actually out-of-scope for Commento++, at least in the short term? I suppose comment plugins are more important for when you don't have your own user database.

waschinski commented 2 years ago

I am in the same boat as you and probably won't use Commento++ for the same reason. No direct login when using SSO is a no-go.

I actually like how FastComments (Saas) is handling that. It provides SSO user data right away with the normal configuration when loading comments. Haven't seen it implemented like that anywhere else.