Skip to content
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

Asking credentials during the WFS loading process, for non-authenticated users #295

Closed
Gpetrak opened this issue Nov 22, 2024 · 2 comments · Fixed by #296
Closed

Asking credentials during the WFS loading process, for non-authenticated users #295

Gpetrak opened this issue Nov 22, 2024 · 2 comments · Fixed by #296
Assignees

Comments

@Gpetrak
Copy link
Contributor

Gpetrak commented Nov 22, 2024

When the user tries to load a layer through WFS, the plugin retrieves the SLD from GeoNode in order to display it as in GeoNode. This is a great feature, but when the user is not authenticated (logged in) with the corresponding GeoServer, the plugin asks the user for the GeoServer credentials during the WFS loading process (in order to retrieve the SLD), or it crashes. I think that we have to handle this behavior, either by disabling the WFS button or by loading the layer without the SLD, when the user is not authenticated. The second case needs further investigation because it can break the logic of SLD / layer upload / reload functionalities.

Screenshot from 2024-11-22 15-15-51

@Gpetrak Gpetrak self-assigned this Nov 22, 2024
@giohappy
Copy link
Contributor

@Gpetrak the REST API is closed to anonymous users. We might decide to change it in the future, and give access to anonymous for the styles (with a security rule like /rest/workspaces/*/styles/*;GET=IS_AUTHENTICATED_ANONYMOUSLY), but for the moment I agree we should use the default style and avoid retrieving the style returned by the API.

I don't see why it should break other functionality, since an anonymous user is not able to modify or upload things.

@Gpetrak
Copy link
Contributor Author

Gpetrak commented Nov 26, 2024

@giohappy thank you for the information. I followed the second approach and the issue was solved. So now, if the user is not authenticated, the plugin loads the layer through WFS without requesting the SLD from GeoNode. In this case, the widget Layer style and the corresponding buttons in the dialog Layer properties >> GeoNode are disabled. I pushed these changes in the PR #296 because the changes are related with the execution or not of the SLD request.

@giohappy giohappy linked a pull request Nov 26, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants