Are there additional steps to enable SignUp with Social Account - django-allauth

This feels like a FAQ, but I've spent a few hours and I'm stuck. When you add facebook and twitter socialapps (following all the documented steps) Should you see these as options on the SignUp form without any additional steps? They did show up on the login form.
Thanks!

This did happen on its own after installing and configuring.
The way I ended up resolving this was to modify templates/account/signup.html so that it offered the signup with Social or Username\password
You need to load the social auth and then add a login button for each social auth provider you're using somewhere in the content block that makes sense in your layout.
{% load socialaccount %}
<div>
<a href="{% provider_login_url "twitter" process="connect" %}">
Connect with Twitter</a>
</div>
<div>
<a href="{% provider_login_url "facebook" process="connect" %}">
Connect with Facebook</a>
</div>

Related

How to log out of the instagram API?

The instagram API authentication page does not have any information on how to log out a user:
On an iOS app using the API, how am I supposed to allow users to log out?
To logout the user you should only delete the token. If the user doesn't want your app to access their data they will cancel your app access.
If you want to provide a way for the user to logout from your app, you can do it on your login implementation (if you have a backend, of course), otherwise just send the user back to the login screen and delete the token.
Im making android app using html5, I did the following:
Redirect the user to a html5 page containing following code:
<div id = "loading" style="text-align: center; display:block; margin-top: 150px;">
<img alt="" src="/css/themes/images/ajax-loader.gif" width="46px" height="46px">
<br><font style="text-align: center;">Logging Out...</font>
</div>
</div>
Then call setTimeout() in which im calling my index.html the homepage after 2seconds.

Rails: Hide Url for a link_to when users inspect element

I have a field in my form where users can put their facebook page for example and in my show page I have a button that redirect users to this facebook page but I want when user Inspect element the URL of the facebook page will be hidden now i have a code like this when I inspect element with Mozilla <a class="btn btn-default" target="_blank" href="http://www.facebook.com"></a> but I want the the facebook URL to be hidden
You can't do this. It is impossible to have something people can click on but which the user can't tell the destination of before clicking. You can make it more or less hassle, but the ultimately the browser has to know, and the browser isn't interested in deceiving the user.

web application login on behalf of another user

I need to enable a logged in user of a web application to perform some functionality on behalf of another user.
For example, lets say I logged in as an restaurant owner and I want to do some of the restaurant manager's work.
I should be able to get the landing page of the restaurant manager while logged inas restaurant owner. The application is built using grails and it will be a great help if you all can share your thoughts and ideas.
If you implement your authentication and user management using the standard spring-security-core plugin then that provides a "switch user" function that handles exactly this situation.
<sec:ifLoggedIn>
Logged in as <sec:username/>
</sec:ifLoggedIn>
<sec:ifSwitched>
<a href='${request.contextPath}/j_spring_security_exit_user'>
Resume as <sec:switchedUserOriginalUsername/>
</a>
</sec:ifSwitched>
<sec:ifNotSwitched>
<sec:ifAllGranted roles='ROLE_SWITCH_USER'>
<form action='${request.contextPath}/j_spring_security_switch_user' method='POST'>
Switch to user: <input type='text' name='j_username'/><br/>
<input type='submit' value='Switch'/>
</form>
</sec:ifAllGranted>
</sec:ifNotSwitched>

invite facebook friends to application without a popup rails

I'm making a simple application to practice learning rails and web development in general.
What I'd like to do is list facebook friends so that I can invite those that don't have the app to come use it with me.
Currently I'm following a tutorial which pops up the friends on facebook I can send the application to. However I'd like to remove the popup option and simply display on the page the facebook friends invitation list (i.e. checkbox, name, picture). How would I go about doing that?
Here is my code of Home.html.erb. Please let me know if you have any suggestions. Thanks!
<div id="friends">
#instead of the below link which creates the pop up, I'd like the page to
#simply display the facebook friends to invite
<p><%= link_to "Invite your Facebook Friends","#",:id=>"invite_fb_friends"%></p>
<div id="fb-root"></div>
<script src ="http://connect.facebook.net/en_US/all.js"></script>
<script>
$(function(){
$("a#invite_fb_friends").click(function(){
FB.init({
appId:'1234567890', #<--fake appid, my code includes the my actual app id
cookie:false,
status:true
});
FB.ui({method:'apprequests',message:'<%=current_user.name%> would like to invite you to try out our app!'});
});
});
</script>
</div>
You can get a user's friends info (provided you have the permissions in the access token) via:
https://graph.facebook.com/:facebook_user_id/friends?access_token=token
You'll receive a json response of the user's friends. Simple parse the JSON code, and from their create a list of friends in the view. Use check boxes or something, compile each ID they select, and create a request
To see what the data looks like, goto: https://developers.facebook.com/tools/explorer
and put in /me/friends

Facebooker with Authlogic is Not Redirecting to the Dashboard After Authorization

Everything seems to be working fine with my implementation of Facebooker with Authlogic (using the authlogic_facebook_connect plugin) except for one thing.
After the initial authorization of the application (by clicking OK on the Facebook pop-up) I still remain on the login page. There is no redirection. However, once I refresh the login page and then click the Facebook button again, there is no popup because it is already authorized by Facebook, instead it redirects to /user_session (for authentication via Facebook session) automatically and immediately takes me to the dashboard page as expected.
Additional Information:
Any idea why it doesn't redirect on the very first click, right after authorizing Facebook? The post-authorize URL is set for http:///user_session/ and the routes for authlogic are set properly.
I have tried with Prototype and jQuery, both give the same results.
You can see the same issue on this tutorial website if you try to authenticate with Facebook. This website is not mine so try at your own risk:
http://facebooker.pjkh.com
Thanks.
Also having the same issue here. I think the reason it was doing nothing for me, using jquery, is the code generated by
<%= authlogic_facebook_login_button :controller => 'customer_session' %>
which is something like
<form id='connect_to_facebook_form' method='post' action='/customer_session'>
<input type='hidden' name='authenticity_token' value='keLV8CIfc5znsRkjhkjhkjhkjhkjh='/>
</form>
<script type='text/javascript' charset='utf-8'>
function connect_to_facebook() {
$('connect_to_facebook_form').submit();
}
</script>
<fb:login-button js="prototype" onlogin="connect_to_facebook()"></fb:login-button>
the jquery to submit the form is wrong it should be
$('#connect_to_facebook_form').submit();
(duh, because I did not pass in :js => :jquery)
but if I fix that I still get
1 error prohibited this customer
session from being saved
There were problems with the following
fields:
* You did not provide any details for authentication
so the right details are not being injected into the form I guess

Resources