Giter Site home page Giter Site logo

csharp_telesign's People

Contributors

adohertyts avatar ernesthwang avatar hmorales avatar illiminable avatar jeremyjc avatar manmohan-kumar avatar mrasic-telesign avatar ramsay avatar spillerl avatar vdamjanic avatar wqaqish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csharp_telesign's Issues

c# SDK generates the "verification" code even if the consumer omits it

It is mentioned numerous times in the documentation that it is a best practice to let Telesign generate the code as it is more secure, but looking at the c# code (SDK) that consumes the REST Api, even if we omit passing the verification code, the c# code detects that there is no code passed so it generate one using Random class and then passes it to the REST api, so technically there is no way to let the REST API generate the code for us.

Here is where the SDK generate the code:
https://github.com/TeleSign/csharp_telesign/blob/master/src/TeleSign.Services.Verify/RawVerifyService.cs#L359

private static Dictionary<string, string> ConstructVerifyArgs(
                    VerificationMethod verificationMethod, 
                    string phoneNumber, 
                    string verifyCode, 
                    string messageTemplate, 
                    string language,
                    string validityPeriod = null,
                    string useCaseId = RawVerifyService.DefaultUseCaseId)
        {
            // TODO: Review code generation rules.
            if (verifyCode == null)
            {
                Random r = new Random();
                verifyCode = r.Next(100, 99999).ToString();
            }
            else
            {
                if (verificationMethod == VerificationMethod.TwoWaySms)
                {
                    throw new ArgumentException("Verify Code cannot be specified for Two-Way SMS", "verifyCode");
                }
            }

.NET Standard support

Was looking in to using the SDK in a .NET Core environment. I installed the code in a console application and it seems to be working just fine, but there is a warning about it being restored using .NET Framework versions. Is there a possibility to target .NET standard in the NuGet version of the package, or would I have to download the SDK and modify it locally?

No way to verify valid code with Telesign SDK

We started looking into upgrading our Telesign SDK to the latest version, I downloaded the latest, and I've noticed that there is no way telesign can generate a code, nor a way to ask telesign to verify the code.

We are an enterprise client, and we are in production right now with Telesign SDK V 1.0. if we consume V2.0 means we have to significantly change our integration to start generating the code and verify it ourselves.

Can someone please clarify, how we're supposed to call telesign api to verify a code when upgrading from V1.0 to V2.0?

.net 6 support

I see there's already an issue about .net standard, but it's 2 years old now. It would be great to see this code updated to support more modern frameworks like .net 6.

The examples provided could use a great deal of simplification as well. At the moment the code is terribly bloated, too general and stateful. Most people are not going to use it to the full extent. It would be good to see more basic examples for those who are just quickly evaluating the product (in my case it was phoneid).

I wrote something like that in f#, feel free to use it: https://github.com/PiotrJustyna/telesign-client-fsharp-phoneid

interface for testability

It would really help if you wrap all service rest clients with interfaces so that consumers of your code can properly test/mock the service.

Please look at my pull request, I added an interface for the VerifyService, the pull request was made on a previous version of the code, but I mentioned it only as an example.

Checking for customer id in the config

I won't say Its an issue - but I dont know how and where to put comments. Just a question If this was intentional not to check for the customer id as well?

csharp_telesign-master\csharp_telesign-master\src\TeleSign.Services\TeleSignService.cs

if (string.IsNullOrEmpty(this.configuration.Credential.SecretKey))
{
throw new ArgumentException("No secret key was provided. Requests to TeleSign services require require a valid customer id and secret key.");
}

Shouldn't the constructor for "TeleSignCredential" checks for null customer id as well?

///

    /// Initializes a new instance of the TeleSignCredential class.
    /// </summary>


    /// <param name="customerId">The customer id.</param>
    /// <param name="secretKey">The customers secret key.</param>
    public TeleSignCredential(
                Guid customerId,
                string secretKey)
    {
        CheckArgument.NotNullOrEmpty(secretKey, "secretKey");
        CheckArgument.NotNullOrEmpty(customerId, "customerId"); // ADDED
        this.CustomerId = customerId;
        this.SecretKey = secretKey;
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.