How to customize my own Facebook Login button? - authentication

When the user loads the page in their browser, the JavaScript SDK renders the Login Button on your page
What if I don't want to use their button?
How to customize my own Facebook Login button?

You should be able to override the CSS. Try using Firebug or the equivalent tool ("Inspect Element") in other browsers to see how it's done. The button is on your site, thus your CSS is taken into consideration. If you make it more specific than the CSS from Facebook, your CSS will take precedence. For example: include the class name or id of an outer element.

Related

When writing end to end selenium tests, should I navigate to a page or just open the URL?

Say I need to submit a form on the 'Classes' page. I am testing the 'enroll into class' feature. Do I navigate to the page by clicking on the menu bar, or do I just directly open the URL of the page?
It depends on the scenario you need to test.
As an autoimation engineer you need to work according to the documentation.
If no scenario defined you can choose easiest way to do that.
Incase clicking on the menu bar is the part of your #Test, you have to access the base page and navigate to the desired page by invoking click() on the menu bar.
Else you can directly open the URL of the page.

Add a Sign in portlet on the login page

I am building a basic login page using the existing sign-in portlet.
I just want to have a functionality that when a user access the website, right now localhost:8080, the sign-in portlet should pop up!
Is this doable? If so, Can someone please hint me how this can be done?
This is how the default page looks like right now:
To log in, I have to explicitely click on the "sign-in" blue button and then it pops out a modal sign in portlet.
But what I am trying to do here is:
Whenever a user clicks on the default url, it should immediately ask the user to login rather than showing a blank page with a sign-in button (something like the output image)
Or even a modal sign-in box (Whatever is easy to customize.)
and
Whenever a user hits any other url for eg. localhost:8080/web/project1/home and if the user is not signed in, it should force him to sign in first.
Two possibilities out of the box:
place nothing but the sign in portlet on the homepage, appearing at that location (typically /web/guest/home)
protect your default page to be not visible to the guest user (this will automatically forward to the sign-in portlet) - see the "Permissions" button on the "Manage Pages" interface
There are more, but these seem to be the first and most obvious ones. Let me know if one of them works for you or what the reason for your request is
From what I understand, you want the Login Portlet to popup as a modal window/lightbox on the current page (i.e. without leaving the page). AFAIK, to achieve this, you'll have to develop all your portlets to use AJAX to create links that point protected resources. So when you get an unauthenticated request, you can stay on the same page and show login dialog.
This is high-level approach. You'll need to 1) embed the Login portlet in your theme and 2) put the below javascript functionality in Theme:
callback function - to handle response for unauthenticated request,
to render modal/lightbox
You might face surprises while implementing this.

Activate Facebook like and facebook comment on same page

Here is my situation.
I have two facebook likes on a single page and a single facebook comment. (using javascript sdk facebook)
I tried to like one of the facebook likes and it opens the facebook login authorization window where i enter my login details. The like works fine for that particular button only. When i click on another like button in the same page, it opens a popup window and closes it suddenly.. But no likes registered for the second button. For the another like button to work, i need to refresh the page... and the same case is with the facebook comments plugin...
Please suggest me a way such that if the user initiates the login using one of the buttons, the other facebook like and the comment will automatically work without the need to refresh the page...I got the clue to refresh the facebook plugins entirely by using
FB.XFBML.parse();
But i don't know to attach the above function to the particular event...
Check this url
http://hillarsaare.com/projects/facebook/multi-like/
Where you can see multiple like buttons on the same page...If you are already logged in through facebook and visit that page, you will be able to like all the posts there...But if you are not logged in and visit that page, clicking one of the like buttons will prompt you to login through facebook and after logging in, you will not be able to like any other posts in the page except that post you clicked like...When you do page refresh, it will work fine...
Thank you
I think that you can use this work-around for every like button on your page:
Subscribing to the auth.statusChange
(http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/)
and check to see if it is a sucessful login. If so, re-render the like
button code into your DOM and then have the Javascript SDK re-parse it
using FB.XFBL.parse()
(http://developers.facebook.com/docs/reference/javascript/FB.XFBML.parse/)
Similar to:
Facebook like button status update

where to get facebook login button

I have implemented facebook authentication for my website with the facebook-omniauth gem. I am simply looking for a "Login From Facebook" button. It seems like facebook only advocates using the login button through the XFBML JS, or through an iframe.
I found that facebook does have various images available on their website:
https://www.facebook.com/images/facebook_logo.gif
https://www.facebook.com/images/fbconnect/login-buttons/connect_light_medium_short.gif
But how can I get access to all of their available images?? (I know I can get a login from facebook image from a 3rd party, but I wanted to get one straight from facebook - just didn't think fb would make it so hard to do without using their javascript libraries or iframes)
http://developers.facebook.com/docs/reference/plugins/login/
here you can generate a button ... not the additional attributes and use them to get different sizes f.e.
sized buttons: small, medium, large, xlarge (default: medium).
Now facebook has their own .png buttons that you can use in your login flow.
Download and follow the instructions
https://developers.facebook.com/docs/facebook-login/checklist/#brandedlogin

using selenium-rc can i load a page, click a bookmarklet, and fill up the in-page loaded form?

Is there anyway by which I can automate the following steps
in Selenium-rc
open a page
click on bookmarklet in browser toolbar
fill up data in the form loaded into the page by said bookmarklet.
If the bookmarklet is not accessible as it is part of the browser/bookmark toolbar,
is there a way in which I can inject the javascript into the page and have it execute?
You are 99% there! You're right, you can't actually click the bookmarklet, but you can inject the same JavaScript in to the page. Simply use the getEval() command to evaluate the JavaScript.