namespace eSuite.API.SingleSignOn;

/// <summary>
/// Internal type used for controlling the single sign on process
/// </summary>
public interface ISingleSignOn
{
    /// <summary>
    /// Start single sign on using an e-mail address
    /// </summary>
    /// <param name="loginEmail"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<string> StartSingleSignOn(string loginEmail, CancellationToken cancellationToken);
    
    /// <summary>
    /// Start single sign on using an ssoProviderId
    /// </summary>
    /// <param name="ssoProviderId"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<string> StartSingleSignOn(long ssoProviderId, CancellationToken cancellationToken);

    /// <summary>
    /// Exchange the authorisation Token and return the SubjectId if successful.
    /// </summary>
    /// <param name="ssoProviderId"></param>
    /// <param name="code"></param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<string> ExchangeAuthorisationToken(long ssoProviderId, string code, CancellationToken cancellationToken);
}