We have integrated Discourse with another app, and users are managed in Keycloak. When a user deletes his account in the other app, we also delete it via API in Discourse.
Works fine, but the user’s IP is then blocked automatically in Discourse, so there is no way to log in as a different user from the same IP.
Can this IP blocking be turned off? Or make it automatically unblock after some time?
Yes. You’ll need to in-check the thing that blocks the ip. See Reverse engineer the Discourse API and see what happens when you do it from the UX.
According to the API documentation for deleting a user, whether it blocks the IP is one of the options passed in with the body of the request.
So in the code where the request is being made, you should be able to provide json in the body of the request which includes ”block_ip”: false.
For example:
{
delete_posts: false,
block_email: false,
block_urls: false,
block_ip: false,
}
I’m not sure if I understand this.
Do you mean I have to unblock the IP via API after the account has been deleted?
I was actually hoping for some configuration switch in Discourse.
Ah, got it. Thanks, will try this.
Hey
Have you gotten your answer here? as ”block_ip”: false, doesn’t work in API request body in my case, so did you have it work or you happen to send another separate request by reverse engineering Discourse API?
It does work for me.
This is our request body:
{
delete_posts: false,
block_email: false,
block_urls: false,
block_ip: false,
}
I wonder if the problem was using "block_ip": false exactly for the request body, as opposed to a JSON object string. I can no longer edit my post but I’ve flagged it to have your JSON added as an example to hopefully make the marked solution clearer.
Thanks for your reply.
We have this in place for the request JSON body {block_email: false} (It’s block_email in our situation), but it doesn’t seem to take effect in user deletion API. We needed to send a separate request to remove the email from the Screened Emails (Blocking Emails).
בהתאם לאופן שבו אתה בונה את מחרוזת ה-JSON שלך (בין אם באופן ידני או עם ספרייה), יכול להיות שתצטרך לנסות בין בחרוזים בודדים, בחרוזים כפולים, או ללא בחרוזים כלל. חוץ מזה, אין לי מושג - ה-API של Discourse בדרך כלל עושה בדיוק את מה שהבטיח.
בסדר, אני אפרסם את זה כאן למי שמתקלל באותה סיטואציה עם API מחיקת המשתמש.
block_ip: False מונע באופן אמין את הוספת ה-IP לרשימות המנוטרים.
block_email: False צריך למנוע את הוספת האימייל לרשימות המנוטרות, אבל כמה מקרים קצה (כמו משתמשים מסומנים כספאם או משתמשים חדשים ברמת TL0) עשויים עדיין לגרום לבדיקה של האימייל גם אם block_email הוא False.
זה ידרוש בקשה נוספת לביטול חומת האימייל מרשימות אימיילים מנוטרים.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.