-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
14 changed files
with
489 additions
and
182 deletions.
There are no files selected for viewing
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
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
39 changes: 39 additions & 0 deletions
39
src/Security/Authentication/OAuth/src/OAuthCodeExchangeContext.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,39 @@ | ||
// 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. | ||
|
||
namespace Microsoft.AspNetCore.Authentication.OAuth | ||
{ | ||
/// <summary> | ||
/// Contains information used to perform the code exchange. | ||
/// </summary> | ||
public class OAuthCodeExchangeContext | ||
{ | ||
/// <summary> | ||
/// Initializes a new <see cref="OAuthCodeExchangeContext"/>. | ||
/// </summary> | ||
/// <param name="properties">The <see cref="AuthenticationProperties"/>.</param> | ||
/// <param name="code">The code returned from the authorization endpoint.</param> | ||
/// <param name="redirectUri">The redirect uri used in the authorization request.</param> | ||
public OAuthCodeExchangeContext(AuthenticationProperties properties, string code, string redirectUri) | ||
{ | ||
Properties = properties; | ||
Code = code; | ||
RedirectUri = redirectUri; | ||
} | ||
|
||
/// <summary> | ||
/// State for the authentication flow. | ||
/// </summary> | ||
public AuthenticationProperties Properties { get; } | ||
|
||
/// <summary> | ||
/// The code returned from the authorization endpoint. | ||
/// </summary> | ||
public string Code { get; } | ||
|
||
/// <summary> | ||
/// The redirect uri used in the authorization request. | ||
/// </summary> | ||
public string RedirectUri { get; } | ||
} | ||
} |
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,31 @@ | ||
// 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. | ||
|
||
namespace Microsoft.AspNetCore.Authentication.OAuth | ||
{ | ||
/// <summary> | ||
/// Constants used in the OAuth protocol | ||
/// </summary> | ||
public static class OAuthConstants | ||
{ | ||
/// <summary> | ||
/// code_verifier defined in https://tools.ietf.org/html/rfc7636 | ||
/// </summary> | ||
public static readonly string CodeVerifierKey = "code_verifier"; | ||
|
||
/// <summary> | ||
/// code_challenge defined in https://tools.ietf.org/html/rfc7636 | ||
/// </summary> | ||
public static readonly string CodeChallengeKey = "code_challenge"; | ||
|
||
/// <summary> | ||
/// code_challenge_method defined in https://tools.ietf.org/html/rfc7636 | ||
/// </summary> | ||
public static readonly string CodeChallengeMethodKey = "code_challenge_method"; | ||
|
||
/// <summary> | ||
/// S256 defined in https://tools.ietf.org/html/rfc7636 | ||
/// </summary> | ||
public static readonly string CodeChallengeMethodS256 = "S256"; | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.