WFS POST request autentication on Mapguide 3.1

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

WFS POST request autentication on Mapguide 3.1

Percy
This post was updated on .
Has anyone else run into a problem with WFS *POST* requests being prompted
for a username and password?  And when entering a username and password gets
redirected to a blank page?

All the normal functionality works as expected via external requests to
https://externalIP/mapguide/mapagent/ > WFS > GetCapabilities >
DescribeFeatureType > GetFeature

Attached is an POST request sent externally from one of my colleges to MGOS
3.1, when he is prompted with authentication and enters the Administrator,
WFS User or newly created user he is reverted to a blank page.

WFS_POST_request.txt
<http://osgeo-org.1560.x6.nabble.com/file/t385100/WFS_POST_request.txt

I also confirmed the WFS username and password via the webconfig.ini and all
is in order.

Just as a extra note we are accessing the WMS and WFS via HTTPS and I noticed while doing a SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities& that the getfeature points to "ows:Post xlink:href="http" as expected it can not be changed from the site administrator > Configure WFS > Server name, even when using the site IP address followed by :443.

Next I changed HTTP to HTTPS in the OgcWfsService.config.awd,
<Define item="Url.GetFeature">https://&SERVER_NAME;&SCRIPT_NAME;</Define> ,when doing a SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities& the request results shows as "ows:Post xlink:href="https" now.


Any ideas would be a real help on how to get around the user and password authentication issue.

--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
mapguide-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Jackie Ng
For anyone experiencing this problem:

If you make WFS requests via POST with an XML body, you must set the
content-type to "text/xml" otherwise the mapagent will reject the request
and send back a 401 unauthorized.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Percy
Hi Jackie

Thank you very much, the POST request with content-type as "text/xml" works
as expected, the only issue I am currently experiencing is with the
resultType="hits" filter/operator which does not seem to work.

When doing the POST request I receive all the features even though I
specified the resultType="hits" filter/operator, do you have any suggestions
on what I can do to get the feature count?

Would there be any feature development in making 'Application/xml' requests?



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Jackie Ng
MapGuide currently does not support the optional resultType=hits feature of
the WFS spec. I do not know of any workaround besides counting the results
manually at the moment.

By "Would there be any feature development in making 'Application/xml'
requests?" I gather you mean can we make MapGuide recognise
"application/xml" as an alternative XML mime type to "text/xml"? Sure it
shouldn't be difficult.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Percy
Hi Jackie,

Thank you very much for the response.

Should I create tickets for:
1. MapGuide to recognize "application/xml" as an alternative XML mime type
to "text/xml"
2. And resultType="hits" as an possible solution in "application/xml" as an
alternative XML mime type to "text/xml"



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Jackie Ng
Go right ahead and make those tickets.

Just be aware that this is effectively a feature enhancement (especially for
2) as I foresee needing to add new APIs to support resultType=hits and that
make it in-eligible for backporting to the 3.1 branch.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Philip Nell
Hi Jacki,

We do not need these two fixes/enhancements backported to version 3.1.  It
can be a new build/version

We can also assist in Development/Testing/QA before the release to ensure
the WFS works correctly and is more OGC compliant.

Philip and Percy



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: WFS POST request autentication on Mapguide 3.1

Jackie Ng
In reply to this post by Jackie Ng
Further addendum:

Either pass "text/xml" as the mime type or ensure your XML body has the XML
prolog (<?xml ...) at the very beginning. If MapGuide finds this prolog, it
will accept it as an XML body regardless of whether you gave the correct
mime type or not.

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/MapGuide-Users-f4182607.html
_______________________________________________
mapguide-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/mapguide-users