Security Challenge Storage Provider

ISecurityChallengeService in assembly SanteDB.Core.Api version 3.0.1980.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

UpstreamSecurityChallengeProvider - (SanteDB.Client)

Remote security challenge provider repository

Service Registration

...
<section xsi:type="ApplicationServiceContextConfigurationSection" threadPoolSize="4">
	<serviceProviders>
		...
		<add type="SanteDB.Client.Upstream.Repositories.UpstreamSecurityChallengeProvider, SanteDB.Client, Version=3.0.1980.0, Culture=neutral, PublicKeyToken=null" />
		...
	</serviceProviders>

AdoSecurityChallengeProvider - (SanteDB.Persistence.Data)

Represents a callenge service which uses the ADO.NET tables

Service Registration

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

Example Implementation

/// Example Implementation
using SanteDB.Core.Security.Services;
/// Other usings here
public class MySecurityChallengeService : SanteDB.Core.Security.Services.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