-
-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure that blocked user sees his block-message #6062
Comments
https://community.openstreetmap.org/t/is-this-the-same-person/123461/19
|
After my second dev user was logged in on the app and was able to "do" stuff, I asked SomeoneElse to block the user for an hour and then tried to upload a change. SC displayed a popup "Authorization error, please try to login again" (login information was discarded) and the log displays this information:
So it seems that the API will display a message localized to the user's setting. I wonder if displaying that in the popup would make any difference, because the display duration is relatively short. |
What happens if you try to login again in StreetComplete? Is the block message displayed at the login screen? |
No, when I click on "Login" it warns about an unpublished edit, ignoring that message, the website shows the "requested methods" list: After clicking "Authorize", the same authorization error is displayed with these messages in the log:
So the I'm baffled by the fact that I can use my login data in the web-window and it displays the methods list and never complains the user is blocked but only gives this information to the app. |
Also, when I explicitly log out of the website widget and login again, the behaviour is the same, i.e. not displaying the block message at all. |
Maybe you still had a login cookie in the webview, i.e. you were already logged in? Or, the oauth flow is hardwired to directly go to the authorization screen, without showing any block message in that flow. |
Say, how does the block message on osm.org look like when you try to log in in the browser? (Does it display properly on small screens like that of a smartphone?) |
That's indeed quite weird. The block message is always shown in the browser, but never in a webview? Or is it dependent on the screen size? What about a browser on the smartphone? Or is the block-message-displaying disabled by being in the oauth flow? |
Is message disappearing when browser window is resized to be tiny? |
I blocked myself and logged into mobile browser and get block message displayed on login |
Being blocked shouldn't stop you being able to login or authorize an OAuth token as far as I know so you should be able to authorize and then get the active block count from the user details API call. |
Hmm apparently it does stop you being able to make the details call but that seems like a bug to me - you just shouldn't be able to edit. |
Yes, that’s a known issue: openstreetmap/openstreetmap-website#3522 |
That's why I suggested opening |
We have blocks with needs_view flag and without it. Only those with needs_view will be shown on login. |
Currently you as an app developer can do the following to detect the block and tell about it to the user:
|
Yes, I set it. What I have not tested personally whether I will see it in oauth flow (AFAIK no) and whether it will be cleared while going through oauth flow |
First of all, we'd need to ensure the user id doesn't get forgotten, when we get a 403, which is the case today upon upload after the user is blocked. The behaviour logging in when already blocked is a whole different story because "now" I only get a Warning about the 403 and the app thinks we were logged in but doesn't show the username, so there's something considerably to do here to figure out a working route with the "known issue" mentioned above. @westnordost playing around with LastUploadErrorEffect I was able to explicitly display a new UserBlockedDialog when we encounter a 403 while uploading, but I don't feel that's enough :-/ |
I tried opening oauth links while having a needs_view block:
|
Just as a reminder, if the GDPR project happens to take off in 2025, calling this endpoint without authentication is supposed to no longer work then: https://wiki.openstreetmap.org/wiki/GDPR/Affected_Services#Methods_for_user_data |
With this issue being depending on time (GDPR 2025) and changes to openstreetmap-website, should this be put into a "Project" to not loose sight of the todo's because there's nothing on the SC side that can be done right now? |
Current state, according to my research and research shared by others:
Also, there is no reasonable stable API that allows to check whether user is blocked. There are ugly workarounds but nothing reasonable. |
I would consider it being blocked by and waiting on openstreetmap/openstreetmap-website#5452 (or other reasonable way to query block status without doing complex and fragile workarounds) Until it happens blocked users may be confused a bit. Thanks again everyone who helped in research and to people improving OSM API (including writing PR, reviewing them and so on). |
Well, in my opinion, not even by the mentioned pull request. It seems like a bug or otherwise an important missing feature in openstreetmap-website that when logging in as part of the oauth flow, the block is not displayed to the user. It doesn't make sense for all openstreetmap editor developers to query some special API in order to display a block message to the user within the app. Instead, the block should just always be displayed when trying to login on osm.org, regardless of normally or as part of an oauth flow.
|
There was
but I guess it does not reject missing display of block message being a bug |
The block is displayed when logging in (no matter what the flow is) if the block wasn't viewed and it needs to be viewed. |
And it is only place where it was checked? So already logged in user will not get any message from osm.org about being blocked (unless they go to block list, manually or via API?) |
Even if they login with oauth into some another OSM editor? From https://github.com/openstreetmap/openstreetmap-website/issues?q=is%3Aissue+oauth+block+message I see no report about this I think about opening following issue: Title: blocks with needs_view flag not shown when user does oauth authorisation (for example login into an OSM editor) Body:
Expected: block message is shown on user entering the site, as from user perspective they log into some software Actual: oauth authorisation appears, control handed to requesting software, user still blocked. I am aware that there are some ugly workarounds that can be done by app, and done by some editing software. |
The second "Login" is not a login. The user is already logged in.
I guess that this "become logged out" is also not an actual logout. |
In the context of StreetComplete, it means that the OAuth token is deleted. For getting a new OAuth token, osm.org is opened within a WebView. In this WebView, the user may still be logged in via a cookie, so that he only needs to re-authorize StreetComplete, rather than input his username and password. |
If the user receives a block while logged in and using your app, how are you going to know that they're blocked? The "instead" part may never happen because they are already logged in and won't try to log in again. What do you do once you discover that the user is blocked is a different question, that's why I also write about step 2 in openstreetmap/openstreetmap-website#5452.
That's not "logging out". If you delete the token, you won't be able to check if the current user is blocked. Other editors probably don't delete the token in this situation, at least iD doesn't as I just checked. |
The point is that the app shouldn't need to know that the user is blocked. If upload gives a 403 error, the API token will be considered invalid and deleted, the user is prompted to "log in again". This will lead him to osm.org in a WebView, in which a block reason should be displayed (but currently isn't). |
403 doesn't make the token invalid. You are deciding to delete a valid token.
The prompt is wrong because it's not a login.
Not necessarily. |
I know. It's a login/logout from the user perspective. |
You may argue that there should be a redirect to needs_view blocks from oauth authorization page too. I don't know why we don't do this, probably for the same reason that there are no redirects from every other page. But even if showing needs_view blocks, by redirect or otherwise, is added to the oauth page, that won't solve all of the problems. What if it's not a needs_view block, what if the block was already viewed? Such block will still give 403s, you'll make the user visit the oauth page again and then what? If openstreetmap/openstreetmap-website#5452 is merged, you'll be able to check if there are viewed / not viewed active blocks. If you delete the token, you lose that ability. |
Authorizing an application by granting it a new oauth token is effectively login from user perspective. |
I opened openstreetmap/openstreetmap-website#5490 - I admit that I have no great hopes for this but wanted to at least try. It really should not be required by every single app that supports login via oauth to support hacky workarounds. |
A user that usually only uses StreetComplete to map should be able to see his block message.
This issue needs research: How does it currently behave when the user is blocked?
https://community.openstreetmap.org/t/is-this-the-same-person/123461
The text was updated successfully, but these errors were encountered: