25.01.2015 Views

CSP Gateway Configuration Guide - InterSystems Documentation

CSP Gateway Configuration Guide - InterSystems Documentation

CSP Gateway Configuration Guide - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Implementing HTTP authentication for <strong>CSP</strong> applications<br />

1. Set the %response.UseASPredirect property to true in the OnPreHTTP method of the page.<br />

<br />

Set %response.UseASPredirect=1 Quit 1<br />

<br />

2. Declare VBScript in the <strong>CSP</strong> page:<br />

<br />

Then, you can add both in-line VBScript and complete scripted sections to the page.<br />

Examples:<br />

<br />

<br />

Response.Write("Message from ASP script")<br />

<br />

<br />

Dim n<br />

For n = 1 To 10 Step 1<br />

Response.write("These lines were generated by \<br />

a 'for' loop in VBSCRIPT: Line # " & n & "")<br />

Next<br />

Complete example:<br />

<br />

Set %response.UseASPredirect=1 Quit 1<br />

<br />

<br />

<br />

<strong>CSP</strong>/VBScript demonstration <br />

<br />

<br />

<strong>CSP</strong>/VBScript demonstration page <br />

<br />

msgbox "Message from client-side vbscript"<br />

document.write "The time is ",time<br />

<br />

<br />

<br />

Response.Write("Message from ASP script")<br />

<br />

<br />

set x="message from Cach&eacute"<br />

<br />

Message from <strong>CSP</strong> #(x)# <br />

<br />

9<br />

2.9 Implementing HTTP authentication for <strong>CSP</strong><br />

applications<br />

This enhancement extends the Apache modules (mod_csp*.so/dll and <strong>CSP</strong>a*[Sys].so/dll) to allow HTTP authentication to<br />

be controlled by Caché/<strong>CSP</strong>.<br />

HTTP authentication of web requests is normally carried out between the web server and client (browser). Because of this<br />

it is not usually possible to implement HTTP authentication in custom request handlers hosted by the web server – such as<br />

CGI programs and web server API-based request handlers. Of course, such extensions can issue a 401 Authorization<br />

Required response header and, in response to this, the browser displays the HTTP login dialogue. However, in the subsequent<br />

request, the web server intercepts the user's login details and attempts to authenticate the user using its own built-in<br />

<strong>CSP</strong> <strong>Gateway</strong> <strong>Configuration</strong> <strong>Guide</strong> 49

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!