Security Challenge Storage Provider

ISecurityChallengeService in assembly SanteDB.Core.Api version 2.1.151.0

Summary

Represents an interface that allows for the retrieval of pre-configured security challenges

Operations

OperationResponse/ReturnInput/ParameterDescription

Get

IEnumerable<SecurityChallenge>

String userName IPrincipal principal

Gets the challenges current registered for the user (not the answers)

Get

IEnumerable<SecurityChallenge>

Guid userKey IPrincipal principal

Gets the challenges current registered for the user (not the answers)

Set

void

String userName Guid challengeKey String response IPrincipal principal

Add a challenge to the current registered user

Remove

void

String userName Guid challengeKey IPrincipal principal

Removes or clears the specified challenge

Implementations

AdoSecurityChallengeProvider - (SanteDB.Persistence.Data.ADO)

Represents a callenge service which uses the ADO.NET tables

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Persistence.Data.ADO.Services.AdoSecurityChallengeProvider, SanteDB.Persistence.Data.ADO, Version=2.1.151.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

Example Implementation

/// Example Implementation
using SanteDB.Core.Security;
/// Other usings here
public class MySecurityChallengeService : SanteDB.Core.Security.ISecurityChallengeService { 
	public String ServiceName => "My own ISecurityChallengeService service";
	/// <summary>
	/// Gets the challenges current registered for the user (not the answers)
	/// </summary>
	public IEnumerable<SecurityChallenge> Get(String userName,IPrincipal principal){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Gets the challenges current registered for the user (not the answers)
	/// </summary>
	public IEnumerable<SecurityChallenge> Get(Guid userKey,IPrincipal principal){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Add a challenge to the current registered user
	/// </summary>
	public void Set(String userName,Guid challengeKey,String response,IPrincipal principal){
		throw new System.NotImplementedException();
	}
	/// <summary>
	/// Removes or clears the specified challenge
	/// </summary>
	public void Remove(String userName,Guid challengeKey,IPrincipal principal){
		throw new System.NotImplementedException();
	}
}

References

Last updated