Steps to create a new SmartDB and setup data and config for SmartDB.SmartUser based authentication

Start by creating a new SmartDB using the steps desribed at 

SmartDB Upgrade and Migration Routine

Setup use of AuthenticationService

Ensure that the AuthenticationService is the default Consultingwerk.Framework.IAuthenticationService implementation. Note that by default the DatabaseAuthenticationService (authenticates against the _user table of a database specified in .applicationsettings) is the active IAuthenticationService implementation:


  <ttServiceLoaderRow>
    <Order>1</Order>
    <ServiceTypeName>Consultingwerk.Framework.IAuthenticationService</ServiceTypeName>
    <ServiceClassName>Consultingwerk.SmartFramework.Authentication.AuthenticationService</ServiceClassName>
    <Disabled>false</Disabled>
  </ttServiceLoaderRow>
  <ttServiceLoaderRow>
    <Order>1</Order>
    <ServiceTypeName>Consultingwerk.Framework.IAuthenticationService</ServiceTypeName>
    <ServiceClassName>Consultingwerk.SmartFramework.Authentication.DatabaseAuthenticationService</ServiceClassName>
    <Disabled>true</Disabled>
  </ttServiceLoaderRow>


By default the reference (sample) SmartFramework start.p in Consultingwerk\Windows\Framework\Reference\start.p loads the authentication service from the file Consultingwerk\SmartFramework\services.xml. As both files are typically overwritten with updates of the SmartComponent Library code base it is recommended to create local copies of both files.

Enable users to change passwords

When user password are stored in the SmartUser table the .applicationsettings file (.applicationsettings.xml on 10.2B) should allow users to change their passwords in the SmartUser table by setting the maintainPasswordInSmartUser setting to true. 


{
    "appServerKeepAlivePeriod":"120",
    "homePageUrl":"http://www.consultingwerk.de",
    "defaultPartition":"Default",
    "maintainPasswordInSmartUser":"true",
    "systemDescription":"Development",
    "rollbaseRestApiUrl":"https://www.rollbase.com/rest/api/",
    "SmtpHostName":"mail.consultingwerk.de",
    "SmtpSenderName":"no-reply@consultingwerk.de",
   
    "InfragisticsStyleSheetFolder": "Consultingwerk/Windows/Styles"
}


Create default user and login company


The SmartDB setup utility does create a set of default user groups. But does not create a default user or login company and does not assign menu structures to the user groups. This is on purpose so that our weekly updates do not (re-)create users, login companies or menu assignment which might conflict with customer requirements.

The procedure Consultingwerk/SmartFramework/Tools/create-initial-smartuser-data.p can be executed against a SmartDB database. Please ensure that the database triggers to the SmartDB are accessible via PROPATH (the triggers are referenced using a relative procedure name starting with SmartDBtrgs/…).


The procedure

  • Creates a default user named “admin” and set the password to “password”.
  • Creates a default company named “demo”
  • Assigns the “admin” user to the already existing “admin” user group.
  • Ensures that two menu structures (one Explorer bar group, one ribbon tab) are assigned to the “admin” group

Using those steps it is possible to login to the SmartFramework application.