The above line of code seems to refer to something that no longer exists or is not applicable to the current helper, as I get an error message in Visual Studio 2012 "The best overload for 'RegisterFacebookClient' does not have a parameter named 'extraData'
@if (OAuthWebSecurity.RegisteredClientData.Count == 0) {
<div class="message-info">
<p>
There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkId=226949">this article</a>
for details on setting up this ASP.NET application to support logging in via external services.
</p>
</div>
} else {
<form method="post">
@AntiForgery.GetHtml()
<fieldset id="socialLoginList">
<legend>Log in using another service</legend>
<p>
@foreach (var client in OAuthWebSecurity.RegisteredClientData) {
<button type="submit" name="provider" value="@client.AuthenticationClient.ProviderName"
title="Log in using your @client.DisplayName account">@client.DisplayName</button>
}
</p>
</fieldset>
</form>
}
I am following the only set of
instructions I could find. Don't know enough about this to develop this myself, so I need to work from an example that works. This example does not work.
The entirety of these instructions are below. If you have done this, could you share your implementation?
WebPages
In _AppStart.cshtml
<div class="csharpcode">
Dictionary<string, object> FacebooksocialData = new Dictionary<string, object>();
let's conclude that the starter site template from WebMatrix puts a few buttons on the screen, and I have been successful in making them work.
That is not the subject of this post.
This post is about a blog entry on the
official information source from the .NET Web Development and Tools group at Microsoft.
The blog entry can be found here: http://blogs.msdn.com/b/webdev/archive/2012/08/24/customizing-the-login-ui-when-using-oauth-openid.aspx
The gentleman here is an Microsoft employee who explains what you need to do to replace the ugly buttons with a nice icon to click on when you want to log in with OAuth or OpenId.
He explains this for Web Forms, MVC and Web Pages
I believe Web Pages = Web Matrix
I have attempted to implement the suggestions he makes for Web Pages.
His suggestions are bad, incomplete, a good starting point, or wishful thinking, I don't know. But what I do know is, that it doesn't work.
I have no frame of reference outside of WebMatrix (is it the same as Web Pages?) and I don't want to have to develop it either.
This is an official Microsoft blog post, and I think it is incorrect.
wavemaster
Participant
1350 Points
1161 Posts
customizing the social media login UI fails (OAuth / OpenId)
Dec 24, 2012 09:13 PM|LINK
I am following the instructions to replace the buttons as will be shown as per the code from the second post, with images from here.
The modification to _appStart.cshtml:
FacebooksocialData.Add("Icon", "~/Images/facebook.png"); OAuthWebSecurity.RegisterFacebookClient( appId: "3blah blah56", appSecret: "9ablahblahf", extraData: FacebooksocialData);The above line of code seems to refer to something that no longer exists or is not applicable to the current helper, as I get an error message in Visual Studio 2012 "The best overload for 'RegisterFacebookClient' does not have a parameter named 'extraData'
Does anyone know what is wrong here?
TIA, Robert
wavemaster
Participant
1350 Points
1161 Posts
Re: customizing the social media login UI fails (OAuth / OpenId)
Dec 24, 2012 09:54 PM|LINK
This are the pieces that make up the standard functionality in the starter site template. This works.:
in _AppStart.cshtml:
OAuthWebSecurity.RegisterTwitterClient( consumerKey: "", consumerSecret: ""); OAuthWebSecurity.RegisterFacebookClient( appId: "", appSecret: "");_ExternalLoginList.cshtml:
@if (OAuthWebSecurity.RegisteredClientData.Count == 0) { <div class="message-info"> <p> There are no external authentication services configured. See <a href="http://go.microsoft.com/fwlink/?LinkId=226949">this article</a> for details on setting up this ASP.NET application to support logging in via external services. </p> </div> } else { <form method="post"> @AntiForgery.GetHtml() <fieldset id="socialLoginList"> <legend>Log in using another service</legend> <p> @foreach (var client in OAuthWebSecurity.RegisteredClientData) { <button type="submit" name="provider" value="@client.AuthenticationClient.ProviderName" title="Log in using your @client.DisplayName account">@client.DisplayName</button> } </p> </fieldset> </form> }bruce le
Member
308 Points
49 Posts
Re: customizing the social media login UI fails (OAuth / OpenId)
Dec 31, 2012 06:42 AM|LINK
the extraData parameter is not passed to facebook. It is for internal use only.
wavemaster
Participant
1350 Points
1161 Posts
Re: customizing the social media login UI fails (OAuth / OpenId)
Dec 31, 2012 02:30 PM|LINK
bruce le,
I am following the only set of instructions I could find. Don't know enough about this to develop this myself, so I need to work from an example that works. This example does not work.
The entirety of these instructions are below. If you have done this, could you share your implementation?
WebPages
<div class="csharpcode">appId: "empty",appSecret: "empty",displayName: "Facebook",</div>- Access this data in the View(in the webpages template case it is Account\_ExternalLoginsListPartial
<div class="csharpcode"> </div> <div class="csharpcode">{</div> <div class="csharpcode"> </div> <div class="csharpcode"> </div>Angie xu - M...
All-Star
20240 Points
1717 Posts
Microsoft
Re: customizing the social media login UI fails (OAuth / OpenId)
Jan 02, 2013 01:26 AM|LINK
Hi wavemaster
You could refer the links below, perhaps it will give you some tips for you,
Using OAuth Providers with MVC 4
http://www.asp.net/mvc/overview/getting-started/using-oauth-providers-with-mvc
How can I get ExtraData from OAuthWebSecurity?
http://forums.asp.net/p/1847724/5174087.aspx/1?Re+Urgent+How+can+I+get+ExtraData+from+OAuthWebSecurity+
Kind regards
Feedback to us
Develop and promote your apps in Windows Store
wavemaster
Participant
1350 Points
1161 Posts
Re: customizing the social media login UI fails (OAuth / OpenId)
Jan 02, 2013 01:59 AM|LINK
let's conclude that the starter site template from WebMatrix puts a few buttons on the screen, and I have been successful in making them work.
That is not the subject of this post.
This post is about a blog entry on the official information source from the .NET Web Development and Tools group at Microsoft.
The blog entry can be found here: http://blogs.msdn.com/b/webdev/archive/2012/08/24/customizing-the-login-ui-when-using-oauth-openid.aspx
The gentleman here is an Microsoft employee who explains what you need to do to replace the ugly buttons with a nice icon to click on when you want to log in with OAuth or OpenId.
He explains this for Web Forms, MVC and Web Pages
I believe Web Pages = Web Matrix
I have attempted to implement the suggestions he makes for Web Pages.
His suggestions are bad, incomplete, a good starting point, or wishful thinking, I don't know. But what I do know is, that it doesn't work.
I have no frame of reference outside of WebMatrix (is it the same as Web Pages?) and I don't want to have to develop it either.
This is an official Microsoft blog post, and I think it is incorrect.
pranav rasto...
Member
286 Points
52 Posts
Re: customizing the social media login UI fails (OAuth / OpenId)
Jan 03, 2013 07:37 AM|LINK
HI wavemaster
Following are some of the answers to your questions. I hope this will unblock you..
Webpages is the programming language which you can use either in VS or WebMatrix.
THe OAUTH functionality is there for the Webpages starter site templates in WebMatrix2 or VS2012. Please do make sure that you have these products.
Also it would help if you can describe how did you create the project in webmatrix. were you using the starter site template in webmatix2?
wavemaster
Participant
1350 Points
1161 Posts
Re: customizing the social media login UI fails (OAuth / OpenId)
Jan 03, 2013 01:25 PM|LINK
WebMatrix 2.0 and Visual Studio Express 2012 Web
Freshly created site with the starter site template.
OAuth and OpenID working with the ugly buttons identical to what you started your thread with.
Let me know if I can send you code samples.