using Microsoft.AspNet.Authentication; using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Authentication; using System; using System.Collections.Generic; using System.Security.Claims; namespace OAuth.AspNet.AuthServer { /// /// Provides context information when processing an Authorization Response /// public class OAuthAuthorizationEndpointResponseContext : BaseOAuthEndpointContext { /// /// Initializes a new instance of the class /// /// /// /// /// public OAuthAuthorizationEndpointResponseContext(HttpContext context, OAuthAuthorizationServerOptions options, AuthenticationTicket ticket, AuthorizeEndpointRequest authorizeEndpointRequest, string accessToken, string authorizationCode) : base(context, options) { if (ticket == null) { throw new ArgumentNullException("ticket"); } Principal = ticket.Principal; Properties = ticket.Properties; AuthorizeEndpointRequest = authorizeEndpointRequest; AdditionalResponseParameters = new Dictionary(StringComparer.Ordinal); AccessToken = accessToken; AuthorizationCode = authorizationCode; } /// /// Gets the identity of the resource owner. /// public ClaimsPrincipal Principal { get; private set; } /// /// Dictionary containing the state of the authentication session. /// public AuthenticationProperties Properties { get; private set; } /// /// Gets information about the authorize endpoint request. /// public AuthorizeEndpointRequest AuthorizeEndpointRequest { get; private set; } /// /// Enables additional values to be appended to the token response. /// public IDictionary AdditionalResponseParameters { get; private set; } /// /// The serialized Access-Token. Depending on the flow, it can be null. /// public string AccessToken { get; private set; } /// /// The created Authorization-Code. Depending on the flow, it can be null. /// public string AuthorizationCode { get; private set; } } }