Select to view content in your preferred language

Incorporating Secured REST Services

2718
26
Jump to solution
05-10-2013 06:36 AM
KennethLyons
Emerging Contributor
I'm having an issue with incorporating a REST Service that requires a username/password in order to view.  I've attempted to use the "Generate Token" option and that has worked for me in the past, however, I'm having no luck this time around. 

Is there something that I'm missing when inputting the code?  below is the URL with token that was generated from the site.

url="https://www.oagisargissvr.beta.state.pa.us/ArcGIS/rest/services/DMVA_SAFER_AVL/MapServer/1?token=UW1....">

I've tried several variations of this (http/https, with/without "1?" before "token")  even generated tokens for each variation.  I must be missing something because this wasn't that difficult in the past. 

thanks in advance for your assistance.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Ken,

   As far as the popups I believe the issue is that you have the popupconfig as a child tag of the layer tag and it is suppose to be an attribute of the layer tag.

            <layer label="Fires" type="feature" visible="false" alpha="1.0"                    popupconfig="popups/PopUp_Fires.xml"                    url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0"/>

View solution in original post

0 Kudos
26 Replies
RobertScheitlin__GISP
MVP Emeritus
Kenneth,

   You should use the token attribute on your layers tag in the Main config.xml

token�??Token value used for accessing secured ArcGIS Server services. Only applies to layers coming from ArcGIS Server, that is, dynamic, feature, image, or tiled.


Docs link:

http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Layer_tag_overview/01m30000000p...
0 Kudos
KennethLyons
Emerging Contributor
Rob,

I think I've figured it out.  My mistake was that I was using the URL for the REST services when generating the token and not the URL for the site that would be accessing the REST services.

I knew it was probably something simple.

Thanks anyway.
0 Kudos
KennethLyons
Emerging Contributor
So I initially had figured out what my issue was, but now, I'm running into an issue where the token doesn't appear to provide access correctly, or for the designated amount of time.  Could this error be related to the ArcServer software?  or am I over looking something simple again?

I keep getting the attached error, even though I have updated the token and inputted the correct URLs.

Any thoughts?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   Are you generating the token using the exact url/machine name that will be using that token (i.e. if I have http://gis.calhouncounty.org/arcgis/rest/someservice/MapServer in my main config then I need to generate the token using the same fully qualified url "http://gis.calhouncounty.org/arcgis/tokens").

Also you need to check your token settings in Server Manager and make sure that you Lifespan of Long-lived Tokens is what you want it to be:

[TABLE="class: esriDisplayDataTable"]Token Settings                            
      
                 [TR]
         Lifespan of Short-lived Tokens:         [TD="class: esriAlignTrailing"]60 minutes[/TD]
       [/TR]
       [TR]
         Lifespan of Long-lived Tokens:         [TD="class: esriAlignTrailing"]1 day
[/TD]
[/TR]
[/TABLE]
0 Kudos
KennethLyons
Emerging Contributor
Rob,

I've attached at screen shot of the info I'm putting into the token generator page (minus Username and generated token).  I'm not doing this any different that I've done with other tokens in the past.  However it's been a while since I've needed to use a token, so either the process has changed, or I'm probably missing something really obvious.  I've even just attempted to use the IP address for the application to which I'm attempting to include these services.

I'll get in contact with the host of the server as per your suggestion on the Server Manager settings.

Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   If the token does work for the day you requested it then it is the issue with the ArcGIS Server manger like I said earlier.
0 Kudos
KennethLyons
Emerging Contributor
Rob,

I was able to adjust for the problem I was having.  The issue went back to a certificate error that wasn't accounted for.  Thanks for your help with that.

The issue I'm running into now, is that the icons are not displaying correctly.  For example, all the icons are showing up as black dots when they should be showing up as different icons.  I've never come across this issue with over services since, in my experience, the icons are defined by the .msd that is published to the server.  Is this something that is specific to a "feature" layer type?

I'm able to view the icons correctly when I view these services in ArcDesktop.  I'm just not sure where the disconnect is.

Thanks again.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   Yes layers that are type feature and not coming from a 10 or greater ArcGIS Server will use a default symbology as the rendering of the features are actually done client side and not on the server. You will have to manually configure symbology for that layer in the main config.xml  See Docs here: http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Rendering_and_Symbology_tags/01...

If the ArcGIS Server supports drawing the symbology client side then the REST Service Directory will have a listing for Drawing Info, like this:

Drawing Info:
Renderer:

    Unique Value Renderer:

    Field 1: type
    Field 2:
    Field 3:
    Field Delimiter: ,
    Default Symbol:

      Unsupported Symbol
    Default Label: Points of Interest
    Unique Value Infos:


    • Value: 3Label: Campground

    • Description:
      Symbol:

        Picture Marker Symbol:

    • Value: 2Label: Contained Fire

    • Description:
      Symbol:

        Picture Marker Symbol:

    • Value: 4Label: Damaged Home

    • Description:
      Symbol:

        Picture Marker Symbol:

    • Value: 0Label: Fire Department

    • Description:
      Symbol:

        Picture Marker Symbol:

    • Value: 6Label: Mountain

    • Description:
      Symbol:

        Picture Marker Symbol:

    • Value: 5Label: Ranger Station

    • Description:
      Symbol:

        Picture Marker Symbol:

    • Value: 1Label: Shelter

    • Description:
      Symbol:

        Picture Marker Symbol:

Transparency: 0
Labeling Info: N/A
0 Kudos
KennethLyons
Emerging Contributor
Rob,

That appears to exactly be what the issue is now.  The server I am pulling from is not 10.0+. 

Do you happen to have an example of this that I can modify?  I'm attempting to do this, but having never used these lines of coding previously, I'm basically doing trial and error.  And the odds are weighed heavily on "error".

Thanks again for helping me identify the problem
0 Kudos