diff options
Diffstat (limited to 'src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationState.cs')
-rw-r--r-- | src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationState.cs | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationState.cs b/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationState.cs new file mode 100644 index 0000000..39437ac --- /dev/null +++ b/src/DotNetOpenAuth.OAuth2/OAuth2/IAuthorizationState.cs @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------- +// <copyright file="IAuthorizationState.cs" company="Andrew Arnott"> +// Copyright (c) Andrew Arnott. All rights reserved. +// </copyright> +//----------------------------------------------------------------------- + +namespace DotNetOpenAuth.OAuth2 { + using System; + using System.Collections.Generic; + + /// <summary> + /// Provides access to a persistent object that tracks the state of an authorization. + /// </summary> + public interface IAuthorizationState { + /// <summary> + /// Gets or sets the callback URL used to obtain authorization. + /// </summary> + /// <value>The callback URL.</value> + Uri Callback { get; set; } + + /// <summary> + /// Gets or sets the long-lived token used to renew the short-lived <see cref="AccessToken"/>. + /// </summary> + /// <value>The refresh token.</value> + string RefreshToken { get; set; } + + /// <summary> + /// Gets or sets the access token. + /// </summary> + /// <value>The access token.</value> + string AccessToken { get; set; } + + /// <summary> + /// Gets or sets the access token issue date UTC. + /// </summary> + /// <value>The access token issue date UTC.</value> + DateTime? AccessTokenIssueDateUtc { get; set; } + + /// <summary> + /// Gets or sets the access token UTC expiration date. + /// </summary> + DateTime? AccessTokenExpirationUtc { get; set; } + + /// <summary> + /// Gets the scope the token is (to be) authorized for. + /// </summary> + /// <value>The scope.</value> + HashSet<string> Scope { get; } + + /// <summary> + /// Deletes this authorization, including access token and refresh token where applicable. + /// </summary> + /// <remarks> + /// This method is invoked when an authorization attempt fails, is rejected, is revoked, or + /// expires and cannot be renewed. + /// </remarks> + void Delete(); + + /// <summary> + /// Saves any changes made to this authorization object's properties. + /// </summary> + /// <remarks> + /// This method is invoked after DotNetOpenAuth changes any property. + /// </remarks> + void SaveChanges(); + } +}
\ No newline at end of file |