Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Frederik Prijck <[email protected]>
  • Loading branch information
2 people authored and czf committed Jan 16, 2024
1 parent 9e9011c commit 0a09a7c
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 8 deletions.
8 changes: 6 additions & 2 deletions src/Auth0.AuthenticationApi/AuthenticationApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,12 @@ public async Task<MfaOobTokenResponse> GetTokenAsync(MfaOobTokenRequest request,
{ "client_secret", request.ClientSecret },
{ "mfa_token", request.MfaToken},
{ "oob_code", request.OobCode},
{ "binding_code", request.BindingCode}
};

body.AddIfNotEmpty("binding_code", request.BindingCode);

ApplyClientAuthentication(request, body);

return await connection.SendAsync<MfaOobTokenResponse>(
HttpMethod.Post,
tokenUri,
Expand Down Expand Up @@ -520,7 +524,7 @@ public Task<PushedAuthorizationRequestResponse> PushedAuthorizationRequestAsync(
}

/// <inheritdoc/>
public Task<AssociateNewAuthenticatorResponse> AssociateNewAuthenticatorAsync(AssociateMfaAuthenticatorRequest request, CancellationToken cancellationToken = default)
public Task<AssociateMgaAuthenticatorResponse> AssociateMfaAuthenticatorAsync(AssociateMfaAuthenticatorRequest request, CancellationToken cancellationToken = default)
{
if (request == null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Auth0.AuthenticationApi/IAuthenticationApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ public interface IAuthenticationApiClient : IDisposable
/// <param name="request"><see cref="AssociateMfaAuthenticatorRequest"/>containing information to enroll a new Authenticator.</param>
/// <param name="cancellationToken">The cancellation token to cancel operation.</param>
/// <returns><see cref="Task"/> representing the async operation containing
/// a <see cref="AssociateNewAuthenticatorResponse" /> with the details of the response.</returns>
/// a <see cref="AssociateMfaAuthenticatorResponse" /> with the details of the response.</returns>
/// <returns></returns>
Task<AssociateNewAuthenticatorResponse> AssociateNewAuthenticatorAsync(
Task<AssociateMfaAuthenticatorResponse> AssociateMfaAuthenticatorAsync(
AssociateMfaAuthenticatorRequest request,
CancellationToken cancellationToken = default);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AssociateMfaAuthenticatorRequest
public string Token { get; set; }

/// <summary>Your application's Client ID.</summary>
[JsonProperty("client_id", Required = Required.Always)]
[JsonProperty("client_id")]
public string ClientId { get; set; }

/// <summary>
Expand All @@ -35,7 +35,7 @@ public class AssociateMfaAuthenticatorRequest
public string ClientAssertionType { get; set; }

/// <summary>The type of authenticators supported by the client. Value is an array with values "otp" or "oob".</summary>
[JsonProperty("authenticator_types", Required = Required.Always)]
[JsonProperty("authenticator_types")]
public List<string> AuthenticatorTypes { get; set; }

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

namespace Auth0.AuthenticationApi.Models
{
public class AssociateNewAuthenticatorResponse
public class AssociateMfaAuthenticatorResponse
{
[JsonProperty("oob_code")]
public string OobCode { get; set; }
Expand Down
12 changes: 11 additions & 1 deletion src/Auth0.AuthenticationApi/Models/MfaOobTokenRequest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace Auth0.AuthenticationApi.Models
{
public class MfaOobTokenRequest
public class MfaOobTokenRequest : IClientAuthentication
{
/// <summary>
/// Your application's Client ID.
Expand All @@ -12,6 +12,16 @@ public class MfaOobTokenRequest
/// Required when the Token Endpoint Authentication Method field at your Application Settings is Post or Basic.
/// </summary>
public string ClientSecret { get; set; }

/// <summary>
/// Security Key to use with Client Assertion
/// </summary>
public SecurityKey ClientAssertionSecurityKey { get; set; }

/// <summary>
/// Algorithm for the Security Key to use with Client Assertion
/// </summary>
public string ClientAssertionSecurityKeyAlgorithm { get; set; }

/// <summary>
/// The mfa_token you received from mfa_required error or access token with enroll scope and audience: https://{yourDomain}/mfa/
Expand Down

0 comments on commit 0a09a7c

Please sign in to comment.