// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Diagnostics.CodeAnalysis;
using System.IdentityModel.Tokens.Jwt;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Authentication;
namespace Microsoft.AspNetCore.Authentication.OpenIdConnect
{
///
/// This Context can be used to be informed when an 'AuthorizationCode' is received over the OpenIdConnect protocol.
///
public class AuthorizationCodeReceivedContext : BaseOpenIdConnectContext
{
///
/// Creates a
///
public AuthorizationCodeReceivedContext(HttpContext context, OpenIdConnectOptions options, AuthenticationProperties properties)
: base(context, options)
{
Properties = properties;
}
public AuthenticationProperties Properties { get; set; }
///
/// Gets or sets the 'code'.
///
public string Code { get; set; }
///
/// Gets or sets the that was received in the id_token + code OpenIdConnectRequest.
///
public JwtSecurityToken JwtSecurityToken { get; set; }
///
/// Gets or sets the 'redirect_uri'.
///
/// This is the redirect_uri that was sent in the id_token + code OpenIdConnectRequest.
[SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings", Justification = "user controlled, not necessarily a URI")]
public string RedirectUri { get; set; }
}
}