Consuming Secure Services

3020
4
Jump to solution
03-29-2012 11:56 AM
MattPohl
Occasional Contributor II
Hello all,

I running into a problem when trying to use secure services with my flex viewer application. Currently I am working inside a LAN using a development server hosting my services and flex viewer application. I am using a self-signed SSL and have required the use of https. I can successfully use a secure service in my application when I am using it on the development server itself, however, when trying to access my application using a different pc (https://serverhostingapp/flexviewer) on our LAN I get fault code 498: invalid token. This process works just fine if the services are not secure.

When setting up the token in the services directory I have tried using both: Web Application URL or HTTP Referrer, and I.P. address options. For the former , I have tried many combinations: https://serverhostingapp/flexviewerhttps://severhostingapp, and just severhostingapp. for the I.P. option i have tried 192.168.0.100. All options seem to result in the same thing.

Any help or suggestions on why this would be happening would greatly appreciated.

Thanks,

Matt
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MattPohl
Occasional Contributor II
Well I got this one figured out. A simple syntax error in my code was the cause or the errors I was getting (forgot to change the urls in my config.xml from http:// to https://.  Thanks again Jon for your suggestions, it's much appreciated.

Matt

View solution in original post

0 Kudos
4 Replies
JonFisher
New Contributor III
Is "serverhostingapp" the same as your ArcGIS Server machine? If so, a good test would be to go to your REST page, get a token (e.g. for us "https://maps.tnc.org" is the machine hosting both AGS and our web apps, so that's the referrer), then paste into the browser the full URL for your secured service, e.g.:
https://maps.tnc.org/ecadpubprodanon/rest/services/TNC_internal/portfolio_auth_WM/MapServer?token=yo... (note that's the actual URL of one of my secured services, so obviously it won't work without a valid token). If your AGS machine and app server are different, you can still try this step and just put the AGS machine's URL as the referrer to make sure the first step (of generating a token) is working properly.

If that works, maybe post your config.xml file with the tokens scratched out, or secure a service that only has public data so that you can post the actual URL that should work here.
0 Kudos
MattPohl
Occasional Contributor II
Thanks Jon for your reply. Yes, AGS and my flex applications are running on the same server. I will try your sugestion once back in the office and post the results.

Thanks again,

Matt
0 Kudos
MattPohl
Occasional Contributor II
Well I got this one figured out. A simple syntax error in my code was the cause or the errors I was getting (forgot to change the urls in my config.xml from http:// to https://.  Thanks again Jon for your suggestions, it's much appreciated.

Matt
0 Kudos
GIS-Cambria
Occasional Contributor II
Is anyone else running into problems with SSL and flex apps? I've run this configuration on a test server that hosts both the app and services, with the services behind SSL, and that works ok. Now I want to run the app on a different server and hit the AGIS server via tokens and ideally proxyurl. However, regardless of the token generation or open crossdomain.xml on the AGIS server I continually get errors trying to access the https url. I'm hoping someone else out there is feeling my pain and had worked through this......... BTW I've tried with both a self-signed SSL and a legitimate domain SSL from a CA (although the server is not seen as on the same domain as the certificate i.e. public access name vs. internal name). I think browsers and AGIS hit a questionable SSL cert--the bright red warnings--and bomb out even if you choose to trust the site and install the certificate. Both IE and Chrome throw the cert. warnings....
0 Kudos