Thursday 13 June 2019

authentication - OpenGeo Suite SDK authenticate


I am using the OpenGeo suite Snapshot 2.2 I have rules in GeoServer that display layers to certain users, and only allow editing to certain layers by certain users. This works fine when using GeoExplorer, the user must login to see the layerrs / edit, but when using the SDK I get no login box, meaning the user stays anonymous which prevents editing.


I read HERE, OpenGeo SDK insturctions that in the gxp.viewer I can add authenticate? Is this what I need to add to bring the login dialogue up? if so how?



Answer



You'll need to implement something similar to the authenticate method in GeoExplorer in your SDK viewer:


https://github.com/boundlessgeo/suite/blob/master/geoexplorer/app/static/script/app/GeoExplorer/Composer.js#L272:L369


but this depends on some server-side JS pieces as well:



https://github.com/boundlessgeo/suite/blob/master/geoexplorer/app/auth.js


basically it's hitting the GeoServer spring authentication endpoint.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...