Ejemplo n.º 1
0
        public async Task <AUTH.CredentialResponseModel> OvhAuthRequestAsync(AUTH.CredentialRequestModel credential1)
        {
            try
            {
                var request = OvhApiTools.PrepareRequest(HttpMethod.Post, "auth/credential");
                request.Headers.Add(SHARED.OvhConstants.OVH_APP_HEADER, this.Credentials.ApplicationKey);
                request.Content = OvhApiTools.JsonContent(credential1);
                var response = await client.SendAsync(request);

                OvhApiTools.Validate(response);
                var modelresult = await OvhApiTools.ReadWithModelAsync <AUTH.CredentialResponseModel>(response);

                return(modelresult);
            }
            catch (Exception ex)
            {
                throw new Exception("OvhAuthRequestAsync " + ex.Message, ex);
            }
        }
Ejemplo n.º 2
0
 public static async Task <AUTH.CredentialResponseModel> OvhAuthRequestAsync(IOvhApiCredentials credential, AUTH.CredentialRequestModel credential1)
 => await new AUTH.AUTHWrapper(credential).OvhAuthRequestAsync(credential1);