Skip to content

Commit e708fc1

Browse files
removing unnecessary string assignment
1 parent ecacea1 commit e708fc1

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

src/Authentication/Authentication.Core/Interfaces/IGraphRequestPopContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public interface IGraphRequestPopContext
1414
Uri Uri { get; set; }
1515
HttpMethod HttpMethod { get; set; }
1616
AccessToken AccessToken { get; set; }
17-
string ProofofPossessionNonce { get; set; }
1817
PopTokenRequestContext PopTokenContext { get; set; }
1918
Request Request { get; set; }
2019
InteractiveBrowserCredential PopInteractiveBrowserCredential { get; set; }

src/Authentication/Authentication.Core/Utilities/AuthenticationHelpers.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,7 @@ private static async Task<PopTokenRequestContext> CreatePopTokenRequestContext(I
479479
// Find the nonce in the WWW-Authenticate header in the response.
480480
var popMethod = GraphSession.Instance.GraphRequestPopContext.HttpMethod ?? HttpMethod.Get;
481481
var popResponse = await popHttpClient.SendAsync(new HttpRequestMessage(popMethod, popResourceUri));
482-
GraphSession.Instance.GraphRequestPopContext.ProofofPossessionNonce = WwwAuthenticateParameters.CreateFromAuthenticationHeaders(popResponse.Headers, "Pop").Nonce;
483-
482+
484483
// Refresh token logic --- start
485484
var popPipelineOptions = new HttpPipelineOptions(new PopClientOptions()
486485
{
@@ -493,7 +492,7 @@ private static async Task<PopTokenRequestContext> CreatePopTokenRequestContext(I
493492
GraphSession.Instance.GraphRequestPopContext.Request.Uri.Reset(popResourceUri);
494493

495494
// Refresh token logic --- end
496-
var popContext = new PopTokenRequestContext(authContext.Scopes, isProofOfPossessionEnabled: true, proofOfPossessionNonce: GraphSession.Instance.GraphRequestPopContext.ProofofPossessionNonce, request: GraphSession.Instance.GraphRequestPopContext.Request);
495+
var popContext = new PopTokenRequestContext(authContext.Scopes, isProofOfPossessionEnabled: true, proofOfPossessionNonce: WwwAuthenticateParameters.CreateFromAuthenticationHeaders(popResponse.Headers, "Pop").Nonce, request: GraphSession.Instance.GraphRequestPopContext.Request);
497496
return popContext;
498497
}
499498
public static RequestMethod ConvertToAzureRequestMethod(HttpMethod httpMethod)

src/Authentication/Authentication/Handlers/AuthenticationHandler.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage
5252
// Continuous nonce extraction on each request
5353
if (GraphSession.Instance.GraphOption.EnableATPoPForMSGraph)
5454
{
55-
GraphSession.Instance.GraphRequestPopContext.ProofofPossessionNonce = WwwAuthenticateParameters.CreateFromAuthenticationHeaders(response.Headers, PopAuthenticationScheme).Nonce;
56-
GraphSession.Instance.GraphRequestPopContext.PopTokenContext = new PopTokenRequestContext(GraphSession.Instance.AuthContext.Scopes, isProofOfPossessionEnabled: true, proofOfPossessionNonce: GraphSession.Instance.GraphRequestPopContext.ProofofPossessionNonce, request: GraphSession.Instance.GraphRequestPopContext.Request);
55+
GraphSession.Instance.GraphRequestPopContext.PopTokenContext = new PopTokenRequestContext(GraphSession.Instance.AuthContext.Scopes, isProofOfPossessionEnabled: true, proofOfPossessionNonce: WwwAuthenticateParameters.CreateFromAuthenticationHeaders(response.Headers, PopAuthenticationScheme).Nonce, request: GraphSession.Instance.GraphRequestPopContext.Request);
5756
}
5857

5958
// Check if response is a 401 & is not a streamed body (is buffered)

src/Authentication/Authentication/Models/GraphRequestPopContext.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ internal class GraphRequestPopContext : IGraphRequestPopContext
1515
public Uri Uri { get; set; }
1616
public HttpMethod HttpMethod { get; set; }
1717
public AccessToken AccessToken { get; set; }
18-
public string ProofofPossessionNonce { get; set; }
1918
public PopTokenRequestContext PopTokenContext { get; set; }
2019
public Request Request { get; set; }
2120
public InteractiveBrowserCredential PopInteractiveBrowserCredential { get; set; }

0 commit comments

Comments
 (0)