MojoAuth.NET.V2 1.0.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package MojoAuth.NET.V2 --version 1.0.1                
NuGet\Install-Package MojoAuth.NET.V2 -Version 1.0.1                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MojoAuth.NET.V2" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MojoAuth.NET.V2 --version 1.0.1                
#r "nuget: MojoAuth.NET.V2, 1.0.1"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MojoAuth.NET.V2 as a Cake Addin
#addin nuget:?package=MojoAuth.NET.V2&version=1.0.1

// Install MojoAuth.NET.V2 as a Cake Tool
#tool nuget:?package=MojoAuth.NET.V2&version=1.0.1                

MojoAuth .NET SDK Documentation

Overview

This SDK allows you to easily integrate MojoAuth into your .NET applications to handle authentication processes like sending magic links, OTP verification via email or phone.

Installation

To get started, add the SDK to your project and instantiate the MojoAuthHttpClient with your credentials.

Authentication Methods

Send a magic link to an email address for authentication.

using MojoAuth.NET;

var mojoAuthHttpClient = new MojoAuthHttpClient("your_client_id", "your_client_secret");
var resp = await mojoAuthHttpClient.SendMagicLink("email.address@example.com");
Console.WriteLine(resp.Result.SessionId);

Alternatively, you can customize the client options:

using MojoAuth.NET;

var mojoAuthHttpClient = new MojoAuthHttpClient(new MojoAuthHttpClientOptions()
{
    Key = "your MojoAuth Client ID",
    Secret = "your MojoAuth Client Secret",
    BaseUrl = "https://your_tenant.mojoauth.com/api" // Optional, for single tenant private cloud
});

var resp = await mojoAuthHttpClient.SendMagicLink("email.address@example.com");
Console.WriteLine(resp.Result.SessionId);
Method Definition
Task<SendMagicLinkResponse> SendMagicLink(string email, string redirectUrl = "", string language = "")
Parameters:
  • email (string): The recipient's email address.
  • redirectUrl (string, optional): URL to redirect the user after successful authentication.

2. Check Authentication Status

Verify the status of the authentication initiated by the magic link.

var status = await mojoAuthHttpClient.CheckAuthenticationStatus("session_id");
Console.WriteLine(status.Result.IsAuthenticated);
Method Definition
Task<AuthenticationStatusResponse> CheckAuthenticationStatus(string sessionId)
Parameters:
  • sessionId (string): The session ID from the authentication process (e.g., magic link or OTP).

3. Send Email OTP

Send a One-Time Password (OTP) to an email address.

var resp = await mojoAuthHttpClient.SendEmailOTP("email.address@example.com");
Console.WriteLine(resp.Result.SessionId);
Method Definition
Task<EmailOTPResponse> SendEmailOTP(string email)
Parameters:
  • email (string): The recipient's email address.

4. Verify Email OTP

Verify the OTP sent to the email address.

var verifyResp = await mojoAuthHttpClient.VerifyEmailOTP("session_id", "123456");
Console.WriteLine(verifyResp.Result.IsAuthenticated);
Method Definition
Task<VerifyOTPResponse> VerifyEmailOTP(string sessionId, string otp)
Parameters:
  • sessionId (string): The session ID received during the OTP sending process.
  • otp (string): The OTP sent to the user's email.

5. Send Phone OTP

Send a One-Time Password (OTP) to a phone number.

var phoneOtpResp = await mojoAuthHttpClient.SendPhoneOTP("phone_number");
Console.WriteLine(phoneOtpResp.Result.SessionId);
Method Definition
Task<PhoneOTPResponse> SendPhoneOTP(string phoneId)
Parameters:
  • phoneId (string): The phone number or ID to send the OTP to.

6. Verify Phone OTP

Verify the OTP sent to the phone.

var phoneVerifyResp = await mojoAuthHttpClient.VerifyPhoneOTP("session_id", "123456");
Console.WriteLine(phoneVerifyResp.Result.IsAuthenticated);
Method Definition
Task<VerifyOTPResponse> VerifyPhoneOTP(string sessionId, string otp)
Parameters:
  • sessionId (string): The session ID received during the OTP sending process.
  • otp (string): The OTP sent to the user's phone.
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 69 9/11/2024
1.0.1 70 9/11/2024
1.0.0 82 9/6/2024