Topics
Published on December 7, 2016 by kudvenkat
Want create site? Find Free WordPress Themes and plugins.

In this video we will discuss implementing login page for ASP.NET Web API.

We want to design a login page. If we provide invalid username and password an error should be displayed.

Add a new HTML page to the EmployeeService project. Name it Login.html.

Please note :
1. sessionStorage data is lost when the browser window is closed.
2. To store an item in the browser session storage use setItem() method
Example : sessionStorage.setItem(“accessToken”, response.access_token)
3. To retrieve an item from the browser session storage use getItem() method
Example : sessionStorage.getItem(“accessToken”)
4. To remove an item from the browser session storage use removeItem() method
Example : sessionStorage.removeItem(‘accessToken’)

On the Register.html page, we do not have Login button, which takes us to the Login page if the user is already registered. So please include Login button just below “New User Registration” text in the th element on Register.html

Text version of the video
csharp-video-tutorials.blogspot.com/2016/12/aspnet-web-api-login-page.html

Slides
csharp-video-tutorials.blogspot.com/2016/12/aspnet-web-api-login-page_7.html

All ASP .NET Web API Text Articles and Slides
csharp-video-tutorials.blogspot.com/2016/09/aspnet-web-api-tutorial-for-beginners.html

All ASP .NET Web API Videos

All Dot Net and SQL Server Tutorials in English
www.youtube.com/user/kudvenkat/playlists?view=1&sort=dd

All Dot Net and SQL Server Tutorials in Arabic
www.youtube.com/c/KudvenkatArabic/playlists

Did you find apk for android? You can find new Free Android Games and apps.

Leave a Reply

8 Comments on "ASP NET Web API login page"

Notify of
avatar

Upendra Sahu
Guest
Upendra Sahu
9 months 2 days ago

Sir, I am trying this example form Angular JS as client and sending the request localhost:49698/token. This works from FIddler, but the same request is not working from Angular JS app(different proj). I am getting 'Access-Control-Allow-Origin' header not present error, while I have enabled CORS in my WebAPI project. All my other URLs work from Angular JS like localhost:49698/api/employees, but this URL localhost:49698/token does not work. Can u pls guide what is the problem here ?

dotnet guy
Guest
dotnet guy
7 months 27 days ago

Hi there, I am having same problem as your. How did you solve this problem? I dont know how to pass username, password and grant_type to the url localhost:49698/token in angular js. I am sure we cannot do that in the query string. Please suggest.

ytfilastu
Guest
ytfilastu
11 months 7 days ago

gr8

Dhiraj Bhavsar
Guest
Dhiraj Bhavsar
11 months 9 days ago

Very nice tutorials.Two suggestions: 1. Would you please upload videos in FullHD (1080p) resolution? 2. please record videos in full screen mode of power point slides.Thanks for bringing the great content to us. 🙂

abhishek sharma
Guest
abhishek sharma
11 months 9 days ago

ur doing great job sir..!!! keep it up ..hope to see more videos on asp

Muhammad Rehbar Sheikh
Guest
Muhammad Rehbar Sheikh
11 months 10 days ago

thank you venkat sir.

Aijay Iphie
Guest
Aijay Iphie
11 months 10 days ago

This is one of the best Web API videos so far, very illustrative and clear .

Tanvir Ahmad Arjel
Guest
Tanvir Ahmad Arjel
11 months 10 days ago

Dear Sir, I am a big fan of your videos and your teaching quality..May be you are the best in the world (at least to me) in this business…Although I know but still I want some extra videos on Authentication and Authorization in ASP.NET Web API with AngularJS from you along with these JQuery Version.Take Care..

wpDiscuz