.Net Interview Questions and Answers

Search:

Explain MVC OAuth ?(ASP.NET MVC Interview questions)

By : Shiv Prasad Koirala | Jun 23rd, 2014 | Views : 4304 | Comments : 0 Bookmark and Share

This MVC Interview question is also asked in a different way "Can we integrate FB and Twitter account authorization with our MVC Application.


One of the most boring process for an end user is registering on a site. Sometimes those long forms and email validation just puts off the user. So how about making things easy by validating the users using their existing facebook / twitter / linkedin / etc accounts. So the user uses something which he already has while the site is assured that this user is a proper user.


This is achieved by using MVC OAuth (Open standard for authorization).



Using MVC Oauth is a three step process:-


  • Register your MVC application / website with the external site i.e. facebook , twitter etc. Once you register your app you get an ID and key from the external site. Below is snap shot of how facebook gives the ID and Key. In FB they term the key as the "App secret". This process varies from site to site. So FB can have X steps while twitter can X+1.



  • Next step is to open "AuthConfig.cs" and you will see lot of readymade code to user your ID and Key. So use the appropriate method as per site and provide the ID and Key.


OAuthWebSecurity.RegisterMicrosoftClient(

                clientId: "",

                clientSecret: "");

 

OAuthWebSecurity.RegisterTwitterClient(

                consumerKey: "",

                consumerSecret: "");

 

OAuthWebSecurity.RegisterFacebookClient(

                appId: "",

                appSecret: "");

OAuthWebSecurity.RegisterGoogleClient();

 


  • Now if you run your application you should get a link to FB login as shown in the below screen. So if you login in FB it will redirect to your MVC application.



You can also see the below video created by Questpond on MVC Web API



Do not miss 100 important MVC Interview question from this codeproject article.


http://www.codeproject.com/Articles/556995/MVC-interview-questions-with-answers

 
Rate this Article :
1 Star
2 Stars
3 Stars
4 Stars
5 Stars
1 1 1 2 1
 
 
 
 

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

.NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala

In this article we will explain .NET interview questions 6th edition (Sixth edition) - By Shivprasad Koirala.... Read More

Explain MVC application life cycle?

In this article we will explain MVC application life cycle.For more articles and videos visit us on www.questpond.com... Read More

What is the difference between Stored Procedures and Function (SQL Server interview question with answers)?

In this article we will explain what is the difference between Stored Procedures and Function.For more articles and videos visit us on www.questpond.com... Read More

C# Design pattern interview questions with answers: - How Singleton is different from Static class?

In this article we will explain How Singleton is different from Static class.... Read More

WCF interview questions and answers: - What is the difference between Service endpoint and Client endpoint?

In this article we will explain What is the difference between Service endpoint and Client endpoint.... Read More

Article Categories

Learn in Hindi