Skip to content

Instantly share code, notes, and snippets.

@explorer14
Created January 10, 2021 19:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save explorer14/6fe0166b3d1bc07e695672d2fb2b6a16 to your computer and use it in GitHub Desktop.
Save explorer14/6fe0166b3d1bc07e695672d2fb2b6a16 to your computer and use it in GitHub Desktop.
/// <summary>
/// A durable and secure place to store authentication token into and get out of
/// </summary>
public interface IAuthTokenRepository
{
/// <summary>
/// Get the currently active auth token. Implementations MUST decide on the appropriate key
/// for the persistance record. The interface assumes that only one token will be returned
/// from the store.
/// </summary>
/// <returns><see cref="AuthToken"/></returns>
Task<AuthToken> GetCurrent();
/// <summary>
/// Store the freshly generated auth token. Implementations MUST decide on the appropriate key
/// for the persistance record.
/// </summary>
/// <param name="token">The <see cref="AuthToken"/> to store</param>
/// <returns><see cref="Task"/></returns>
Task Save(AuthToken token);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment