This repository has been archived by the owner on Dec 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce new events to allow controlling the signin, signout and cha…
…llenge operations
- Loading branch information
1 parent
8effbcf
commit d95810b
Showing
12 changed files
with
1,445 additions
and
79 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/AspNet.Security.OpenIdConnect.Server/Events/ProcessChallengeResponseContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
83 changes: 83 additions & 0 deletions
83
src/AspNet.Security.OpenIdConnect.Server/Events/ProcessSigninResponseContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/AspNet.Security.OpenIdConnect.Server/Events/ProcessSignoutResponseContext.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
} | ||
} |
Oops, something went wrong.