Zum Hauptinhalt gehen

Use of GenerateToken and DisplayForm

Kommentare

11 Kommentare

  • Ryan Cooney

    Hi Steven,

    You are correct. The properties of the AutoCompleteBox (or any other FormItem) do not accept variables as input. They require literal values. In the next release of Essentials we have provided a mechanism that allows you to make runtime modifications to forms so very soon you will be able to achieve what you are after. It is a bit of a different concept that what you might expect, but it is very powerful and allows you to manipulate any aspect of the form.

    In the mean time you will likely need to stick with your workaround.

    --Ryan

    0
  • Permanently deleted user

    Thanks Ryan.  I appreciate the quick follow up.

    0
  • Permanently deleted user

    Ryan, 

    Extending the the topic of this thread a little, are you able to elaborate as to what is currently supported with 3.8, workflow & secured services?  

    I currently do not have the proxy solution in place, but if i do, are there still limitations w.r.t. workflows (in my case a simple workflow that will select a number of features through a query & generate a report - is this currently possible?).

    Appreciate if you are able to clarify the above ASAP as i had a deliverable that i am now concerned is not possible using 3.8?

    Brad

    0
  • Permanently deleted user

    Ryan / @Latitude - appreciate if you are able to provide any input to my query below.

    Cheers

    Brad

    0
  • Ryan Cooney

    Brad,

    This issue is specific to the use of tokens within a DisplayForm activity.

    Let’s assume we have a form with an AutoCompleteBox input that needs to be able to query a token secured map service. When the AutoCompleteBox performs its queries it is the end user’s web browser that actually makes the request to ArcGIS Server (as opposed to the server running Essentials). Since the service is secured the AutoCompleteBox needs to be pre-configured with a token to be able to connect. In Essentials 3.8 and older you could create a token that will be valid for the end user’s HTTP Referrer using the GenerateToken activity, however there was no mechanism to allow you to pass that token from a variable in the workflow to the AutoCompleteBox item in the form. Effectively there was no way to use a AutoCompleteBox with a token secured service (unless you set up a proxy to circumvent security).

    In Essentials 3.9 (released yesterday) there is now a way to apply runtime values from variables in a workflow to form items. Have a look at the updated DisplayForm activity documentation for more details.

    The QueryTask activity and the other activities in the ArcGIS Server category run on the server and accept a token as an input argument so they are not affected by the above limitation. In this case you would likely generate a token for the IP address of the Essentials machine rather than using a referrer. The only exception to this, that I can think of, is the Geoprocessor activity. It is special because it has both a client and server component when running an asynchronous GPTask. So you would not be able to use it (without a proxy) if your GPTask is both asynchronous and secured.

    --Ryan

    0
  • Permanently deleted user

    Ryan, 

    Log file below... Seem to infer token is expired or invalid? Timeout should not be a problem as i have set to 300 sec (short-lived) in rproxy settings.

    Brad

     

    <Event Timestamp="2012-05-17T15:54:18.750127-06:00" Level="WARN" Identity="Guest"><Message>Authentication failure: Geocortex.ApplicationServices.Security.Enforcement.AuthenticationException: The system could not validate the given credentials. ---&gt; System.ServiceModel.FaultException: The given token is either expired or invalid.

    Server stack trace:

     

       at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)

     

       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

     

       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

     

       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:

     

       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)

     

       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&amp; msgData, Int32 type)

     

       at Geocortex.ApplicationServices.Security.TokenSecurity.ITokenProvider.Decode(String token)

     

       at Geocortex.ApplicationServices.Security.TokenSecurity.TokenProviderClient.Decode(String token)

     

       at Geocortex.ApplicationServices.Security.TokenSecurity.TokenProviderExtensions.Cache`1.Decode(ITokenProvider provider, String token)

     

       at Geocortex.ApplicationServices.Security.TokenSecurity.TokenProviderExtensions.Decode[T](ITokenProvider provider, String token)

     

       at Geocortex.ApplicationServices.Security.Enforcement.Authorization.GetPrincipal()

     

       --- End of inner exception stack trace ---

     

       at Geocortex.ApplicationServices.Security.Enforcement.Authorization.GetPrincipal()

     

       at Geocortex.Essentials.Rest.EssentialsRestRequestDispatcher.GetPrincipal()

     

    The Zone of the assembly that failed was:

     

    MyComputer</Message></Event>

     

    <Event Timestamp="2012-05-17T15:54:18.750127-06:00" Level="WARN" Identity="Nobody"><Message>Authorization failure: Geocortex.ApplicationServices.Security.Enforcement.AuthorizationException: The current user cannot access the desired resource.

     

       at Geocortex.Essentials.Site.Authorize()

     

       at Geocortex.Essentials.Rest.EssentialsRestController.GetSite(String siteId, Boolean clone)

     

       at Geocortex.Essentials.Rest.EssentialsRestController.GetSite(String siteId)

     

       at Geocortex.Essentials.Rest.Resources.RunWorkflowOperation.Init()

     

       at Geocortex.Rest.Handling.RestController.InitResource(RequestContext context, RestContext restContext)

     

       at Geocortex.Essentials.Rest.EssentialsRestController.InitResource(RequestContext context, RestContext restContext)

     

       at Geocortex.Rest.Handling.RestRequestDispatcher.InitResource()

     

       at Geocortex.Essentials.Rest.EssentialsRestRequestDispatcher.DispatchRequestUsingEssentialsSecurity()

     

       at Geocortex.Essentials.Rest.EssentialsRestRequestDispatcher.ProcessRequestUnderContext()

     

    The Zone of the assembly that failed was:

     

    MyComputer</Message></Event>

     

    <Event Timestamp="2012-05-17T15:54:28.9534479-06:00" Level="ERROR" Identity="brad.fisher"><Message>Workflow 'stakeholder_workflow' failed. Cause: Geocortex.Workflow.WorkflowException: Aborted exception: 'Unauthorized access'. ---&gt; ESRI.ArcGIS.Client.Tasks.ServiceException: Unauthorized access

     

       at Geocortex.Workflow.Activities.QueryTask.Execute(NativeActivityContext context)

     

       at System.Activities.NativeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)

     

       at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)

     

       at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

     

       --- End of inner exception stack trace ---</Message></Event>

     

    <Event Timestamp="2012-05-17T15:54:28.9534479-06:00" Level="ERROR" Identity="brad.fisher"><Message>Exception has been thrown by the target of an invocation.

     

    Workflow 'stakeholder_workflow' failed

     

    Aborted exception: 'Unauthorized access'.

     

    Unauthorized access</Message></Event> 

     

     

    0
  • Permanently deleted user

    Ryan, 

    I can actually confirm this issue also exists in my TEST enviro so the rproxy config does not seem to be the resulting issue.

    Brad

    0
  • Permanently deleted user

    Ryan, 

    So you don't waste your time on this I've raised a support call on this issue as i need resolution ASAP.  

    Will update forum thread in due course.

    Brad

    0
  • Permanently deleted user

    Now that 3.9 is available I'm trying to take advantage of the runtime modification Ryan mentioned.  I started a (https://support.geocortex.com/Forums/Thread.aspx?thread=47071&mid=2&pageid=0&ItemID=20) new thread asking for help with the configuration but it isn't generating many views, so I'll try here...

    I have a search workflow that generates a token to connect to a secured map service.  It works as it should, except for the Auto Complete Box.  I have a workaround in place as discussed earlier.

    I've upgraded to 3.9 and have the RuntimeModifications sequence available now, but I need some help configuring the sequence.

    I have a string variable named "tokenString" generated by the GenerateToken Activity.  I know I have to add an Assign Activity to the sequence but I'm unclear on what goes in the "To" and "Value" arguments.

    Can anyone provide an example of how that is configured?

    Thanks,

    Steve

     

    0
  • Permanently deleted user

    Please download our Workflow Designer Guide, available alongside the Essentials download in our Downloads section. In section 5.3.4, or page 47 in the version that comes with Essentials 3.9, you will find discussion and examples of how to set many common form items from the Runtime Modifications sequence.

    In general, you will need something that looks like this:

         form.Find(Of AutoCompleteBoxFormItem)("AutoCompleteBox1").Token = tokenString.

    The left and right sides of the '=' sign are the 'To' and 'Value' boxes respectively. The string in quotes is the ID of your particular autocompletebox -- by default these will be numbered sequentially as you add them, but you can change these IDs if you like.

    If Workflow Designer complains that it does not know what an 'AutoCompleteBoxFormItem' is, you will need to add a 'reference' to the assembly 'Geocortex.Forms.Client.Items' to your Workflow. Click on the 'Imports' button at the bottom of the screen, start typing the name of the assembly, and hit enter.

    0
  • Permanently deleted user

    Sorry for the delay getting back to this.  Your instructions were exactly what I needed to get the Runtime Modifcation to work, Jonathon.  Thanks!

    Steve

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.