diff --git a/src/Auth0.AuthenticationApi/AuthenticationApiClient.cs b/src/Auth0.AuthenticationApi/AuthenticationApiClient.cs index 429c07ea..beb735f8 100644 --- a/src/Auth0.AuthenticationApi/AuthenticationApiClient.cs +++ b/src/Auth0.AuthenticationApi/AuthenticationApiClient.cs @@ -365,8 +365,12 @@ public async Task 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( HttpMethod.Post, tokenUri, @@ -520,7 +524,7 @@ public Task PushedAuthorizationRequestAsync( } /// - public Task AssociateNewAuthenticatorAsync(AssociateMfaAuthenticatorRequest request, CancellationToken cancellationToken = default) + public Task AssociateMfaAuthenticatorAsync(AssociateMfaAuthenticatorRequest request, CancellationToken cancellationToken = default) { if (request == null) { diff --git a/src/Auth0.AuthenticationApi/IAuthenticationApiClient.cs b/src/Auth0.AuthenticationApi/IAuthenticationApiClient.cs index b9000d0f..6724c309 100644 --- a/src/Auth0.AuthenticationApi/IAuthenticationApiClient.cs +++ b/src/Auth0.AuthenticationApi/IAuthenticationApiClient.cs @@ -196,9 +196,9 @@ Task PushedAuthorizationRequestAsync(PushedA /// containing information to enroll a new Authenticator. /// The cancellation token to cancel operation. /// representing the async operation containing - /// a with the details of the response. + /// a with the details of the response. /// - Task AssociateNewAuthenticatorAsync( + Task AssociateMfaAuthenticatorAsync( AssociateMfaAuthenticatorRequest request, CancellationToken cancellationToken = default); diff --git a/src/Auth0.AuthenticationApi/Models/AssociateMfaAuthenticatorRequest.cs b/src/Auth0.AuthenticationApi/Models/AssociateMfaAuthenticatorRequest.cs index f1c47bba..da2a96a0 100644 --- a/src/Auth0.AuthenticationApi/Models/AssociateMfaAuthenticatorRequest.cs +++ b/src/Auth0.AuthenticationApi/Models/AssociateMfaAuthenticatorRequest.cs @@ -10,7 +10,7 @@ public class AssociateMfaAuthenticatorRequest public string Token { get; set; } /// Your application's Client ID. - [JsonProperty("client_id", Required = Required.Always)] + [JsonProperty("client_id")] public string ClientId { get; set; } /// @@ -35,7 +35,7 @@ public class AssociateMfaAuthenticatorRequest public string ClientAssertionType { get; set; } /// The type of authenticators supported by the client. Value is an array with values "otp" or "oob". - [JsonProperty("authenticator_types", Required = Required.Always)] + [JsonProperty("authenticator_types")] public List AuthenticatorTypes { get; set; } /// diff --git a/src/Auth0.AuthenticationApi/Models/AssociateNewAuthenticatorResponse.cs b/src/Auth0.AuthenticationApi/Models/AssociateNewAuthenticatorResponse.cs index d01830ce..9939261c 100644 --- a/src/Auth0.AuthenticationApi/Models/AssociateNewAuthenticatorResponse.cs +++ b/src/Auth0.AuthenticationApi/Models/AssociateNewAuthenticatorResponse.cs @@ -3,7 +3,7 @@ namespace Auth0.AuthenticationApi.Models { - public class AssociateNewAuthenticatorResponse + public class AssociateMfaAuthenticatorResponse { [JsonProperty("oob_code")] public string OobCode { get; set; } diff --git a/src/Auth0.AuthenticationApi/Models/MfaOobTokenRequest.cs b/src/Auth0.AuthenticationApi/Models/MfaOobTokenRequest.cs index 844cdc21..64aaa67a 100644 --- a/src/Auth0.AuthenticationApi/Models/MfaOobTokenRequest.cs +++ b/src/Auth0.AuthenticationApi/Models/MfaOobTokenRequest.cs @@ -1,6 +1,6 @@ namespace Auth0.AuthenticationApi.Models { - public class MfaOobTokenRequest + public class MfaOobTokenRequest : IClientAuthentication { /// /// Your application's Client ID. @@ -12,6 +12,16 @@ public class MfaOobTokenRequest /// Required when the Token Endpoint Authentication Method field at your Application Settings is Post or Basic. /// public string ClientSecret { get; set; } + + /// + /// Security Key to use with Client Assertion + /// + public SecurityKey ClientAssertionSecurityKey { get; set; } + + /// + /// Algorithm for the Security Key to use with Client Assertion + /// + public string ClientAssertionSecurityKeyAlgorithm { get; set; } /// /// The mfa_token you received from mfa_required error or access token with enroll scope and audience: https://{yourDomain}/mfa/