Skip to content
This repository has been archived by the owner on Dec 24, 2020. It is now read-only.

Commit

Permalink
Introduce new events to allow controlling the signin, signout and cha…
Browse files Browse the repository at this point in the history
…llenge operations
  • Loading branch information
kevinchalet committed Oct 8, 2017
1 parent 8effbcf commit d95810b
Show file tree
Hide file tree
Showing 12 changed files with 1,445 additions and 79 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server
* for more information concerning the license and the contributors participating to this project.
*/

using AspNet.Security.OpenIdConnect.Primitives;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;

namespace AspNet.Security.OpenIdConnect.Server
{
/// <summary>
/// Represents the context class associated with the
/// <see cref="OpenIdConnectServerProvider.ProcessChallengeResponse"/> event.
/// </summary>
public class ProcessChallengeResponseContext : BaseControlContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProcessChallengeResponseContext"/> class.
/// </summary>
public ProcessChallengeResponseContext(
HttpContext context,
OpenIdConnectServerOptions options,
AuthenticationTicket ticket,
OpenIdConnectRequest request,
OpenIdConnectResponse response)
: base(context)
{
Options = options;
Ticket = ticket;
Request = request;
Response = response;
}

/// <summary>
/// Gets the options used by the OpenID Connect server.
/// </summary>
public OpenIdConnectServerOptions Options { get; }

/// <summary>
/// Gets the authorization or token request.
/// </summary>
public new OpenIdConnectRequest Request { get; }

/// <summary>
/// Gets the authorization or token response.
/// </summary>
public new OpenIdConnectResponse Response { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server
* for more information concerning the license and the contributors participating to this project.
*/

using AspNet.Security.OpenIdConnect.Primitives;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;

namespace AspNet.Security.OpenIdConnect.Server
{
/// <summary>
/// Represents the context class associated with the
/// <see cref="OpenIdConnectServerProvider.ProcessSigninResponse"/> event.
/// </summary>
public class ProcessSigninResponseContext : BaseControlContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProcessSigninResponseContext"/> class.
/// </summary>
public ProcessSigninResponseContext(
HttpContext context,
OpenIdConnectServerOptions options,
AuthenticationTicket ticket,
OpenIdConnectRequest request,
OpenIdConnectResponse response)
: base(context)
{
Options = options;
Ticket = ticket;
Request = request;
Response = response;
}

/// <summary>
/// Gets the options used by the OpenID Connect server.
/// </summary>
public OpenIdConnectServerOptions Options { get; }

/// <summary>
/// Gets the authorization or token request.
/// </summary>
public new OpenIdConnectRequest Request { get; }

/// <summary>
/// Gets the authorization or token response.
/// </summary>
public new OpenIdConnectResponse Response { get; }

/// <summary>
/// Gets or sets a boolean indicating whether an access token
/// should be returned to the client application.
/// Note: overriding the value of this property is generally not
/// recommended, except when dealing with non-standard clients.
/// </summary>
public bool IncludeAccessToken { get; set; }

/// <summary>
/// Gets or sets a boolean indicating whether an authorization code
/// should be returned to the client application.
/// Note: overriding the value of this property is generally not
/// recommended, except when dealing with non-standard clients.
/// </summary>
public bool IncludeAuthorizationCode { get; set; }

/// <summary>
/// Gets or sets a boolean indicating whether an identity token
/// should be returned to the client application.
/// Note: overriding the value of this property is generally not
/// recommended, except when dealing with non-standard clients.
/// </summary>
public bool IncludeIdentityToken { get; set; }

/// <summary>
/// Gets or sets a boolean indicating whether a refresh token
/// should be returned to the client application.
/// Note: overriding the value of this property is generally not
/// recommended, except when dealing with non-standard clients.
/// </summary>
public bool IncludeRefreshToken { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
* See https://github.com/aspnet-contrib/AspNet.Security.OpenIdConnect.Server
* for more information concerning the license and the contributors participating to this project.
*/

using AspNet.Security.OpenIdConnect.Primitives;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Http;

namespace AspNet.Security.OpenIdConnect.Server
{
/// <summary>
/// Represents the context class associated with the
/// <see cref="OpenIdConnectServerProvider.ProcessSignoutResponse"/> event.
/// </summary>
public class ProcessSignoutResponseContext : BaseControlContext
{
/// <summary>
/// Creates a new instance of the <see cref="ProcessSignoutResponseContext"/> class.
/// </summary>
public ProcessSignoutResponseContext(
HttpContext context,
OpenIdConnectServerOptions options,
AuthenticationTicket ticket,
OpenIdConnectRequest request,
OpenIdConnectResponse response)
: base(context)
{
Options = options;
Ticket = ticket;
Request = request;
Response = response;
}

/// <summary>
/// Gets the options used by the OpenID Connect server.
/// </summary>
public OpenIdConnectServerOptions Options { get; }

/// <summary>
/// Gets the logout request.
/// </summary>
public new OpenIdConnectRequest Request { get; }

/// <summary>
/// Gets the logout response.
/// </summary>
public new OpenIdConnectResponse Response { get; }
}
}
Loading

0 comments on commit d95810b

Please sign in to comment.