To see authentication in action, you can make a slightly more interesting
Hello World example named Hello User that requires authenticated access and responds with a
personalized greeting.
-
Log in to SkyVault Share.
- Type http://localhost:8080/share in the web browser.
- If prompted, log in with the user name admin and password admin.
- Click the Repository link in the Share header.
- Navigate to Data Dictionary > Web Scripts Extensions.
-
Create a web script description document for the Hello User example.
- In the Create menu, select XML.
- Enter hellouser.get.desc.xml as the web script name in the Name field.
-
Enter the following in the content box:
<webscript> <shortname>Hello User</shortname> <description>Personalized greeting</description> <url>/hellouser</url> <authentication>user</authentication> <negotiate accept="text/html">html</negotiate> <negotiate accept="application/json">json</negotiate> </webscript>
- Click Create.
- Click the Web Scripts Extensions directory again to return to the folder.
-
Create a web script response template to render the Hello User greeting.
- In the Create menu, select Plain Text.
- Enter hellouser.get.html.ftl as the template name in the Name field.
- Type Hello ${person.properties.userName} in the content box.
- Click Create.
- Again, navigate back to the Web Scripts Extensions folder by clicking on it in the breadcrumb trail.
-
Register the Hello User web script with SkyVault Content Services.
- Open a new browser tab.
- Type http://localhost:8080/alfresco/service/index in the web browser.
- If prompted, log in with the user name admin and password admin.
-
Click Refresh Web Scripts.
A message indicates there is one additional web script.
-
Type http://localhost:8080/alfresco/service/hellouser in the web
browser to test the new web script.
A Hello admin message displays indicating your web script is working.