(C# ASP.NET Core) How to use Semantic Kernel for OTP based Authentication and Registration in an ASPNET Core Web Application

This is an ASPNET Core project that uses Semantic Kernel for illustrating how OTP based Authentication and Registration can conveniently be done in an ASPNET Core Web Application. Github links to source code are given below.
(Rev. 12-Sep-2025)

Categories | About |     |  

Parveen,

Github Link for Source Code

The source code is on github.

Click -> GITHUB LINK

About this Project

This is an ASPNET Core Project that avoids use TOO MANY if-else statements, and boxes for registering a user into our website with name and phone, and then sending an OTP for verification. The use of AI helps us give a personalized and smoother experience to the user.

The best part is that if the user has to be authenticated through a head-less interface, powered by a mic, then this is going to be a very successful approach.

Video Explanation (see it happen!)

Please watch the following youtube video:

Add these Nugets


Install - Package Microsoft.EntityFrameworkCore

Install-Package Microsoft.EntityFrameworkCore.Sqlite

Install-Package Microsoft.EntityFrameworkCore.Tools

Install-Package Microsoft.SemanticKernel.Connectors.AzureAIInference -prerelease

Install-Package Microsoft.SemanticKernel

Install-Package Microsoft.SemanticKernel.Agents.Core

Install-Package Microsoft.SemanticKernel.Yaml

API Keys can be had for Free

Please watch the following youtube video:

The above video explains how to get apiKey, modelId and endpoint.

MUST GIVE readonly PERMISSION TO MODEL AS EXPLAINED IN THE VIDEO.

The interface in the video might change with time but the concept is expected to remain same.

IMPORTANT: I have used Azure AIInference because of free keys. For other options please refer -> Chat completion with MSDN Semantic Kernel Setup documentation (read the whole page)

ASPNET Core Projects

Please visit this page for projects - Source code here

Github Link for Source Code

The source code is on github.

Click -> GITHUB LINK


This Blog Post/Article "(C# ASP.NET Core) How to use Semantic Kernel for OTP based Authentication and Registration in an ASPNET Core Web Application" by Parveen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.