All client APIs provide for specifying redirect URLs. As a result, AJAX is not needed to invoke the APIs. Luminate Online APIs can redirect after method execution to a specified URL, either on Luminate Online or on another system. The redirect, success_redirect and error_redirect parameters are optional parameters which can be passed on invocation of any client API.
Specifying a redirect parameter may result in a HTTP 302 "Redirect" status being returned to the client's browser following method invocation. The call may or may not have succeeded, depending on which parameter was used:
The sign_redirects parameter is an optional boolean parameter, which, if true, instructs Luminate Online to sign redirects with a timestamp and the API secret key.
Using the sign_redirects option, the target can verify that a redirect request originated with Luminate Online. Otherwise it is impossible to trust that the page being served in response after an action is completed (e.g. a successful login or a completed donation) is being requested as a byproduct of completing that action or if it was just coming from any other source (e.g. a link or direct entry into the browser address bar).
The URL is signed by adding a timestamp to the query string. Then an MD5 or SHA-1 hash of the URL query string plus the CONVIO_API_SECRET_KEY are calculated and the result is appended to the query string. The CONVIO_API_SECRET_KEY should be a value that is not easily guessed and should never be stored or communicated in clear text. This is in direct contrast to the CONVIO_API_KEY, which can be communicated in clear text and is frequently visible in URLs or in the source code view of a web page.
When a redirect is specified to an external domain, the API will first check to see if it has already pushed a session cookie on the insecure channel. If not, it will actually generate 2 consecutive redirects to ensure that the session cookie is passed on the insecure channel.
This is particularly important in single-sign-on implementations to ensure that links from the partner system connect back to the same session that authenticated the user originally.
Request parameters can be substituted into the redirect URL by specifying as the value of a query string parameter in the URL. This functionality is useful for redisplaying the data that was entered by the user.
For security reasons, some parameters are never passed in a redirect URL. These include:
Any value that would normally be returned in the response XML can be substituted into the redirect URL. The response values use XPath syntax to identify the value from the response XML (for example, error_code=). This feature is necessary for error handling, displaying confirmation codes, and retrieving cons_id from the return. Because the response is a structured XML document, you may use XPath syntax for accessing the variables from the response.
Typically, the response documents are fairly simple and the path used to access a variable will be a simple directory path.
Comments