telesign / csharp_telesign Goto Github PK
View Code? Open in Web Editor NEWThe Telesign C# SDK lets you easily integrate with our REST API.
License: MIT License
The Telesign C# SDK lets you easily integrate with our REST API.
License: MIT License
Any chance you could publish a nuget package for this? This would enable easy consumption in .NET code.
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");
}
}
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?
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?
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
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.
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?
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;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.