Using the Automated Tool
We've provided an automated FoxPro script -
UserSecurityManager_AddToProject.prg - that can be used to update an existing Web Connection 7.0+ project by adding the necessary dependencies to integrate the User Security Manager.
In order for this automated tool to work you need:
- A Web Connection 7.0+ project
- A project that uses the well-known project
You can use older version projects, but some portions (especially the Process class configuration) may not work as the tool makes assumptions for file locations and a few template strings contained in project files that are not generated by older projects. You can still run the tool and it will set what it can, but you'll want to go over the manual steps and compare settings to ensure settings were set properly.
Please make sure you create a backup of your existing project. Either commit to source control or otherwise make a back up of your existing project. This tool will make changes to your existing project's code, and the changes are one-way and cannot be rolled back.
Backup first, ask questions later.
Make sure you don't run this tool multiple times. If for some reason you need to re-run this tool, first revert back to a backup or previous source control state, then re-run. Running the tool multiple times will result in duplication of various settings and operations that can break your code.
As part of the download of this library, there's a reference integration project that is shippet in addition to the User Security Manager base project. The SecurityTest project contains a full integration of the User Security Manager that works and has all the integration steps applied so it makes for a good reference that you can compare your own project against.
To run the configuration tool open the UserSecurity Manager property and make sure the project works and runs (
DO UserSecurityManagerMain.prg). Specifically make sure that all the paths are set properly so that Web Connection support files can be found.
For demonstration purposes I'll use SecurityTest and SecureyProcess as the project and process class names of the project to integrate into
- Open the UserSecurityManager Project
- Make sure you are running in the UserSecurityManager's
- Make sure all paths are set (run
DO SETPATHSor open with shortcut/config.fpw settings)
- Make sure the project runs (
DO UserSecurityMainand check requests)
Once the project runs properly run the integration tool
UserSecurityManager_AddToProject.prg. In order to run it you'll need to pass two parameters:
- Your project's Main prg file (
- Your project's Process prg file (
- Your project's primary script map extension (
You should run (all one line):
UserSecurityManager_AddToProject( "c:\webconnectionProjects\SecurityTest\deploy\SecurityTestmain.prg", "c:\webconnectionProjects\SecurityTest\deploy\SecureProcess.prg", "st")
This tool will run very quickly and display a wait window when it's done.
The tool does the following:
- Creates a
UserSecurityManagerfolder in your project's Deploy folder
- Copies Web folder files (
- Creates a scriptmap for
.usmin your web.config
- Hooks up the
usmscriptmap in your main prg's
- Hooks up
UserSecurityManagerProcessin your main prg
- Configures your Process class to use the new Auth code
- Adds Sign in Widget into
- Creates a
default.sthome page from default.htm if it doesn't exist
Once complete your application can now
Profile.usm to access the most common sign in features and the authentication form automatically routes to these requests. There's also an admin link for
admin/UserList.usm for user administration.
Remember that the default Signin Widget only shows up on Script and Template pages that use a _layout page. Any coded pages, or script pages that don't use the _layout page will need to explicitly add the sign in display in some other way. If you're using scripts you can explicit
<%= RenderPartial("~/usermanager/LoginMenu_Partial.usm) %>.
Comment or report problem with topic