GCF Variable Substitution in destURL

I'm testing a GCF connector for an external web application that has pretty simple authentication. The app requires username and password to be POSTed, and then returns a temporary webpage with a

META HTTP-EQUIV="REFRESH" CONTENT="0; URL=...

tag. Note, the response code is 200 and not an HTTP redirect...

The URL in the meta redirect contains a query string of:

USER=somebody&PROJECTID=9&MRP=session_number

This query string is then included with every request the browser makes to the external system. Seems like a nice system to learn GCF on. There are no cookies set whatsoever by this system, so I have neither pickup.response nor pickup.remoteurl set.

In my connector, I am doing the following:

<authenticate>
<CLIENT>
<SESSION a:server="${properties.externalSystemURL}">
<POST a:url="${properties.loginURL}" a:redirects="no">
<PARAM a:name="USER" a:value="${_USERNAME}"/>
<PARAM a:name="PASSWORD" a:value="${_PASSWORD}"/>
</POST>
<SEARCH a:symbol="_SESSION_ID" a:source="${_RESPONSE}" a:value="${_VALUE}">
<GRAB a:start="MRP=" a:end="&"/>
</SEARCH>
<RESULT a:value="TRUE" />
</SESSION>
</authenticate>

This successfully posts the login credentials that I have supplied Luminis for my test account with the cptool set user ExteralAccount command. Furthermore, it parses the temorary HTML page returned with a 200 response code, and pulls out the session value with a GRAB. I can watch the successful authentication to my external system by following the cpipconnector log.

I seem to be having trouble with the destination URL, however. My understanding from prior posts was that I could use these GCF variables in the destUrl parameter of a cpip link. For example:

http://myserver.foo.edu/cp/ip/login?sys=myExtSys&destUrl=http://myExtSys?USER=somebody&PROJECTID=9&MRP=session_number

That doesn't work though. GCF never seems to expand those variables.

If, on the other hand, I use a CPIP Inline Frame channel it does seem to expand the variables.

Any thoughts on why the variables would be expanded with a CPIP channel, but not when used with a CPIP link? Also, would you handle the meta redirect any differently?

best,
Scott

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

correction

Before someone points out the obvious typo above....


http://myserver.foo.edu/cp/ip/login?sys=myExtSys&destUrl=http://myExtSys?USER=somebody&PROJECTID=9&MRP=session_number

should be:

http://myserver.foo.edu/cp/ip/login?sys=myExtSys&destUrl=http://myExtSys?USER=${_USERNAME}&PROJECTID=9&MRP=${_SESSION_ID}

If I use this in a link in the portal, I don't see the variables being expanded.

Thanks,
Scott

destURL

Are you URL encoding the destURL ? You might want to try that.

Shyam

Interesting Findings...

Well, I thought I had tried that but I went back and tried again. I'm not sure what I've tried and not tried at this point :)

I think all my problems go back to my other post. I can't even get a GCF connector to initialize without including the es.url property in configman. If I don't include es.foo.url, then I get the following in cp.log:

cp.log.7:java.util.MissingResourceException:

<|>com.sct.pipeline.lang.ConfigurationManager<|>getUnresolvedProperty.error.property_unknown<|>es.foo.url<|>com.pipeline.extsys.MMServlet

So, just for grins, I just changed es.foo.url to http://localhost, and sure enough my SSO failed because my link was redirected to http://localhost even though I specified

http://myserver.foo.edu/cp/ip/login?sys=myExtSys&destUrl=http://myExtSys?USER=somebody&PROJECTID=9&MRP=session_number

in the cpip link, so I'm missing something fundmental here.

Also, I tried changing my es.foo.url to:

http://myExtSys?USER=somebody&PROJECTID=9&MRP=session_number

That produced an interesting error in cp.log as well:

java.util.MissingResourceException: <|>com.sct.pipeline.lang.ConfigurationManager<|>getProperty.error.macro_is_undefined<|>_USERNAME<|>es.foo.url<|>http://myExtSys?USER=somebody&PROJECTID=9&MRP=session_number<|>com.pipeline.extsys.MMServlet

So, I'm missing something I think... and I think it has to do with my other query about why I am required to specifiy es.foo.url.

Or, perhaps I am not entering the macro properly in the CPIP url?

Any comments much appreciated...

best,
Scott

defect

Well, I opened a support case at the same time as posting to LDN. The support team came back and said it shouldn't be so, but they have been receiving reports of this behavior. Therefore, they labeled it a defect.

I think I also just realized I was testing with version 3.1 of the gc.jar file. Now, I'll re-try everything with 3.3 of the gc.jar.

Syndicate content