This class is responsible for managing local sessions (via a synchronized pattern) as well as upstream sessions which need to interact with the upstream, as well as transitioning between the two.
/// Example Implementation
using SanteDB.Core.Security.Services;
/// Other usings here
public class MySessionProviderService : SanteDB.Core.Security.Services.ISessionProviderService {
public String ServiceName => "My own ISessionProviderService service";
/// <summary>
/// Fired when the session provider service has established
/// </summary>
public event EventHandler<SessionEstablishedEventArgs> Established;
/// <summary>
/// Fired when the session provider service has ended by the user's decision
/// </summary>
public event EventHandler<SessionEstablishedEventArgs> Abandoned;
/// <summary>
/// Fired when the session provider service has been extended
/// </summary>
public event EventHandler<SessionEstablishedEventArgs> Extended;
/// <summary>
/// Establishes a session for the specified principal
/// </summary>
public ISession Establish(IPrincipal principal,String remoteEp,Boolean isOverride,String purpose,String[] scope,String lang){
throw new System.NotImplementedException();
}
/// <summary>
/// Authenticates the session identifier as evidence of session
/// </summary>
public ISession Get(Byte[] sessionId,Boolean allowExpired){
throw new System.NotImplementedException();
}
/// <summary>
/// Gets active sessions for the user.
/// </summary>
public ISession[] GetUserSessions(Guid userKey){
throw new System.NotImplementedException();
}
/// <summary>
/// Extend the session with the specified refresh token
/// </summary>
public ISession Extend(Byte[] refreshToken){
throw new System.NotImplementedException();
}
/// <summary>
/// Abandons the session
/// </summary>
public void Abandon(ISession session){
throw new System.NotImplementedException();
}
public ISession[] GetActiveSessions(){
throw new System.NotImplementedException();
}
}