Author |
Topic |
|
pierretopping
Junior Member
United Kingdom
224 Posts |
Posted - 28 October 2011 : 15:01:24
|
Just looking at a local website forum that's not snitz (silly them...), and I notice you have the option to logon using a facebook account? Anybody every tried this with snitz, can it be done?
http://oldmerthyr1.proboards.com/index.cgi
Thanks,
Pierre |
|
Webbo
Average Member
United Kingdom
982 Posts |
Posted - 28 October 2011 : 17:25:15
|
I think that is using Windows Live log-in
How to incorporate it into Snitz, I haven't a clue
Edit: more info here: https://msm.live.com/app/default.aspx |
Edited by - Webbo on 28 October 2011 17:26:19 |
|
|
golfmann
Junior Member
United States
450 Posts |
Posted - 29 October 2011 : 11:19:18
|
Facebook: 600,000 accounts "compromised" a day and you want them to get into your forum?
I'll pass. |
|
|
pierretopping
Junior Member
United Kingdom
224 Posts |
Posted - 29 October 2011 : 13:37:50
|
Thanks all for your thoughts :-) |
|
|
RichardKinser
Snitz Forums Admin
USA
16655 Posts |
Posted - 29 October 2011 : 14:35:12
|
I absolutely hate all the things that are going to requiring (or have it as an option) a facebook account to login. A lot of iOS apps are going this way unfortunately. |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 31 October 2011 : 08:56:15
|
you can easily integrate the Login with Facebook.
Facebook uses OAuth 2.0 so it's very easy to follow up the OAuth rules and implement such, you will need one more field in the users table to hold the authentication token to provided you with "Who are you?" and then auto login with the normal user.
I do that in some of my web apps, though I don't do it on my Snitz Forum as I only have one and though they are more than 250 users that "liked" our page, I don't think that would be a great feature as the age of my forum users are normally 40+
|
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
pierretopping
Junior Member
United Kingdom
224 Posts |
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 31 October 2011 : 16:20:07
|
That's just one social plugin, a "ready-to-use" tool if you want information to fill up automatically if user is already signed up in Facebook.
you would only need the Facebook Connect button and request the permissions you need, or use the Facebook Javascript SDK (witch is the one I use most) to accomplish what you want.
Let's say that you only need email and name, so: Basic + Email permissions:
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : 'YOUR_APP_ID', // App ID
channelURL : '//WWW.YOUR_DOMAIN.COM/channel.html', // Channel File
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
oauth : true, // enable OAuth 2.0
xfbml : true // parse XFBML
});
// Additional initialization code here
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
function facebookLogin() {
FB.login(function (response) {
access_token = response.session.access_token;
if (response.session) {
if (response.perms) {
// refresh page
window.location.reload();
} else {
// user is logged in, but did not grant any permissions
}
} else {
// user is not logged in
}
}, { perms: 'email' });
}
</script>
and in your page use:
<a href="#" class="myButton" onclick="facebookLogin();">Connect to Facebook</a>
or if you want to use Facebook buttons:
https://developers.facebook.com/docs/reference/plugins/login/
custom examples: http://www.fbrell.com/xfbml/fb:login-button
after the window.location.reload(); you are able to get what you want from facebook, such as the the user Name, Email, etc with
FB.api('/me', function (user) {
if (user != null) {
if (user.error) {
// can't get info
} else {
var image = document.getElementById('image');
image.src = 'https://graph.facebook.com/' + user.id + '/picture';
var name = document.getElementById('name');
name.innerHTML = user.name
}
}
});
more here: https://developers.facebook.com/docs/guides/web/ |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
|
|
pierretopping
Junior Member
United Kingdom
224 Posts |
Posted - 01 November 2011 : 14:41:58
|
That's great. Thank you for your time explaining it to us :-) |
|
|
balexandre
Junior Member
Denmark
418 Posts |
Posted - 01 November 2011 : 21:54:03
|
an easy way of doing all this, is upon getting "email", "name" and "avatar", just create a normal user account with the "facebook_user_id" as the username, and next time user is on the website, just login automatically with those credentials ...
as soon as the user gives you permissions to grab the data you request, he does not need to do anything else, every time you initialize the facebook javascript and ask for the user credentials using the FB.api('/me', function(response) {
alert(response.name);
}); request, it's all there.
You you need more help, just ask |
Bruno Alexandre (Strøby, DANMARK)
"a Portuguese in Danmark"
|
Edited by - balexandre on 01 November 2011 21:54:43 |
|
|
|
Topic |
|