In this Lesson
In this lesson you will enhance the Party Pool to require user authentication.
Soiree provides a sample sign on scene along with agents for sign on and sign off processing. In this lesson you will be using those samples to require users to authenticate before they can access the solution.
Install the Security Samples
- Right click on the Party project and open the Soiree Project Configuration tool
- Add the Signon and Menu Samples to your project
It will add the navigation and security packages to the com.seronix.soiree package.
Rename the Signon Samples
You will now rename the sign on samples so they become part of your solution.
- Right click on the com.seronix.soiree.security package and select Refactor – Rename….
- Rename the package as shown here
NoticeWhen you rename/move an Sx Item file Soiree will refactor the item’s id as well as any references to the modified item. For example, the Signon agent’s ID changed when you renamed the package. The SampleSignon scene, which was referencing the agent as com.seronix.soiree.security.agent.Signon now references the agent as com.example.party.security.agent.Signon.
- The package has been moved. Notice the agent classes have errors. This is because their superclass was deleted when the agent item files were moved.
NoticeWhen an Sx Item file is deleted or moved Soiree deletes the src-gen files associated with the item.
- Rebuild the agents by right-clicking on the com.example.party.security package and using the context context menus as shown here
The superclass files should now appear in the src-gen folder in the new package location
- Change the superclass import in both agents to begin with com.example.party. instead of com.seronix.soiree
The errors should now be resolved
- Rename the SampleSignon.sxScene to Signon.sxScene. Your project should now look like this
Add some personality to the sign on scene
- Download an image for the scene.
- Right Click on the Party Fish
- Select Save Image As… from the pop-up menu.
- Download a font for the scene.
- Click on the font image to download the font.
Daniel Font License
- Open the Signon scene
- Add the fish image to the Images catalog
- Add the font file to the Fonts catalog
- Modify the sign on scene to look something like this
- Save the scene
Add the Signon scene to your solution
You will now configure your solution to use the Signon scene.
- Open the PartyPool solution
- Set the initial and home scenes to the values shown here
Test the Signon scene
- Start the Derby database if it is not already running
- Start SxServer if it is not already running
- Start the PartyPool solution
The sign on scene should be the first things you see (the solution’s initial scene)
- Sign on using the administrator account
User ID = admin
password = admin
You will advance to the solution’s home scene
- Notice the ability to delete or edit a user is not available.
You secured both of these features in the Rights Lesson and the admin user has not been granted those rights. You will be granting those rights to users in the next lesson.
Add sign off capability
Now that your solution is using a sign on scene we should also provide a way to sign off.
- Open the PartyDefinition scene
- Add the following hyperlink to layer 1
- Switch to the Agent Binding perspective and add the Signoff agent to layer 1 and bind its signoff event to the hyperlink element.
- Retest the solution
- Pressing the log off link will remove the user from the connection and take you back to the sign on scene.
That’s all for this lesson.