No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
In order to Hash and Validate Turnkey passwords, | In order to Hash and Validate Turnkey passwords, add two ExternalLateBound methods to SysUser. | ||
HashPassword(pwd:String):String | HashPassword(pwd:String):String | ||
VerifyHashedPassword(hash:String; pwd:String):Integer | VerifyHashedPassword(hash:String; pwd:String):Integer | ||
Line 6: | Line 6: | ||
These methods must have Tagged Value Eco.ExternalLateBound on them. Set any value - we only check its existence. | These methods must have Tagged Value Eco.ExternalLateBound on them. Set any value - we only check its existence. | ||
'''NOTE''': When you run with CodeDress, you should '''leave Body empty''' for ExternalLateBound methods | '''NOTE''': When you run with CodeDress, you should '''leave Body empty''' for ExternalLateBound methods. If it is not empty, this will be executed instead of ExternalOverride. Leaving it empty will force the Codegen to create a stub - but this will be ignored for ExternalLateBound. Mind that you may need to add return statements, etc to the stub to make it compile. Like this: | ||
public string HashPassword(string pwd) | public string HashPassword(string pwd) | ||
{ | { |
Revision as of 07:21, 23 June 2023
In order to Hash and Validate Turnkey passwords, add two ExternalLateBound methods to SysUser.
HashPassword(pwd:String):String VerifyHashedPassword(hash:String; pwd:String):Integer
SysUser must also have an attribute Email:string(?) in .net core since the underlying pwd salt uses the email.
These methods must have Tagged Value Eco.ExternalLateBound on them. Set any value - we only check its existence.
NOTE: When you run with CodeDress, you should leave Body empty for ExternalLateBound methods. If it is not empty, this will be executed instead of ExternalOverride. Leaving it empty will force the Codegen to create a stub - but this will be ignored for ExternalLateBound. Mind that you may need to add return statements, etc to the stub to make it compile. Like this:
public string HashPassword(string pwd) { return ""; }
The VerifyHashedPassword returns an integer that is defined as:
Failed = 0, Success = 1, SuccessRehashNeeded = 2