TFA/MFA Secret Generator

ITwoFactorSecretGenerator in assembly SanteDB.Core.Api version 2.1.151.0

Summary

Identifies a class which can generate TFA secrets

Properties

PropertyTypeAccessDescription

Name

String

R

Gets the name of the TFA generator

Operations

OperationResponse/ReturnInput/ParameterDescription

GenerateTfaSecret

String

none

TODO

Validate

Boolean

String secret

Validates the secret

Implementations

Simple TFA Secret Generator - (SanteDB.Server.Core)

Represents a TFA secret generator which uses the server's clock

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Server.Core.Security.SimpleTfaSecretGenerator, SanteDB.Server.Core, Version=2.1.151.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

Example Implementation

/// Example Implementation
using SanteDB.Core.Security.Services;
/// Other usings here
public class MyTwoFactorSecretGenerator : SanteDB.Core.Security.Services.ITwoFactorSecretGenerator { 
	public String ServiceName => "My own ITwoFactorSecretGenerator service";
	/// <summary>
	/// Gets the name of the TFA generator
	/// </summary>
	public String Name {
		get;
	}
	public String GenerateTfaSecret(){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Validates the secret
	/// </summary>
	public Boolean Validate(String secret){
		throw new System.NotImplementedException();
	}
}

References

Last updated