infobip / infobip-api-csharp-client

Infobip API client library in C#, distributed as a NuGet package.
https://www.infobip.com/docs/api
MIT License
11 stars 17 forks source link

unauthorized during app cration #25

Open EduartHajko opened 1 year ago

EduartHajko commented 1 year ago

hello i have created an account in info bip and enabled the 2fa for my user and i constantly get unauthorized i have tried and with postman i get unatharized during the app creation thanks in advance

private static readonly string BASE_URL = "https://lz5kpj.api.infobip.com"; private static readonly string API_KEY = "924cf6c39fceeba5184822f7f3be3fa9-27a5aa73-1f35-462c-a541-92070c8c66da";

    var configuration = new Infobip.Api.Client.Configuration()
            {
                BasePath = BASE_URL,
                ApiKeyPrefix = "APP",
                ApiKey = API_KEY
    };

    var tfaApi = new TfaApi(configuration);
    TfaApplicationConfiguration configuration2 = new TfaApplicationConfiguration()
    {
     AllowMultiplePinVerifications = true,
    PinAttempts = 5,
    PinTimeToLive =  "15m",
    SendPinPerApplicationLimit =  "10000/1d",
    SendPinPerPhoneNumberLimit = "3/1d",
    VerifyPinLimit = "1/3s",

    };
   // Step 1: Create a 2FA application
    var tfaApplicationRequest = new TfaApplicationRequest(configuration: configuration2, name: "2FA Application edi", enabled: true);
    var tfaApplication = tfaApi.CreateTfaApplication(tfaApplicationRequest);
lvukadinovic-ib commented 1 week ago

Hi @EduartHajko, if you're getting UNAUTHORIZED also via postman then it's probably not related to the SDK. Could you please try again with the new API key and paste the error message if it appears again.