YAY! If you weren't already in the holiday mood with the growing number of Christmas lights appearing, trees going up, Black Friday and Cyber Monday shoppers, then maybe this will do it for you. :-) The Holiday E book on TpT is ready! I should say E BOOKS, because there are 3 this year! There's a 1-2 version, 3-6 version, and 7-12 version to suit your needs. The E books are each filled with 50, yes 50 holiday FREEBIES from some of TpT's finest! The E book can be downloaded at the following TpT stores...
1-2 Holiday Freebies
3-6 Holiday Freebies
7-12 Holiday Freebies
I was SO HAPPY to be able to contribute TWO FREEBIES to one of the E books this year! I hope you can use and ENJOY this holiday season. :-)
Bananas for the HOLIDAY SEASON! *Maybe, just maybe I'll get my own tree and lights up this weekend! ;-)
CYBER Mon. & Tues. SALE
HAPPY THANKSGIVING blog friends! Hoping this season finds you thankful for so many things. My list is so long I don't even know where to begin. The 4 F's are at the top of my list: Faith, Family, Friends, and Freedom! The 3 T's are right up there close to the top of my list, too...Teaching, Tea (love my tea!), and TpT!
TpT is showing their gratitude for teachers and the hard work they put in daily by running a HUGE CYBER DAY SALE! Join myself and other sellers on Monday, Nov. 26th and Tuesday, Nov. 27th @ TpT for 28% off all your favorite items! Be sure to use the promo code CMT12 when checking out to get the additional % off your purchase!
Stock up on your favorite units, activities, games and more at huge savings! I'm looking forward to having my WHOLE store on sale! Here's a look at some of the newest items you can find... *Click any of the pics for direct links!
Blessings to you and yours this Thanksgiving!
Bananas for some time off work to spend with family,
Other fabulous sellers who are participating in the TpT sale below!
TpT is showing their gratitude for teachers and the hard work they put in daily by running a HUGE CYBER DAY SALE! Join myself and other sellers on Monday, Nov. 26th and Tuesday, Nov. 27th @ TpT for 28% off all your favorite items! Be sure to use the promo code CMT12 when checking out to get the additional % off your purchase!
Stock up on your favorite units, activities, games and more at huge savings! I'm looking forward to having my WHOLE store on sale! Here's a look at some of the newest items you can find... *Click any of the pics for direct links!
Blessings to you and yours this Thanksgiving!
Bananas for some time off work to spend with family,
Other fabulous sellers who are participating in the TpT sale below!
GUEST BLOG: Who are your business travel villains?
Without a doubt our award for Business Travel Villain goes to roaming charges! No one likes them and yet we all get them when travelling abroad and there is very little we can do about it – or is there? Here at RoamingExpert.com we have put together a guide with some handy hints and tips on how to banish that villain or at least reduce its impact on your budget.
This blog was written by Kate Staley, marketing manager with Roaming Expert. You can contact her at kate.staley@roamingexpert.com and find out more about the company at www.roamingexpert.com
Look at where you roam to
Where is it that you travel to mainly? Is it outside of Europe, within Europe or all a combination of both? Each network has slightly different rates depending on where you go.
Do you use voice, data or both?
What is your main concern when roaming? is it your voice calls, data usage or both? Again, different networks have different charges for voice and data and some are more competitive than others so it is important to know how you need to use your mobile when you are roaming.
What handset do you use?
We would always recommend using a Blackberry as they compress data more efficiently than other handsets and so data charges will always be less.
What are your roaming rates like?
Are your current roaming rates competitive? Or are they actually over inflated? What are you being charged to visit the countries you do? Roaming rates from provider to provider vary greatly some are vastly overinflated.
Do you know how your network bills?
The networks bill completely differently, some calls may be included in inclusive minutes and some may not. Also some networks charge per minute and some per second, this can make a big difference to your final bill.
Renewing your mobile contract may not be the top of your list of priorities but if you want to avoid a major travel villain in today’s new, global and technologically focused world it could well pay to re assess your contract. Finding out a little more about it and taking some top tips on how to best deal with the situation could well pay off and we are here to help too of course!
This blog was written by Kate Staley, marketing manager with Roaming Expert. You can contact her at kate.staley@roamingexpert.com and find out more about the company at www.roamingexpert.com
GUEST BLOG: SMM: So much talk, so little action
Everywhere we look someone is discussing meetings: meetings management, strategic meetings management, small meetings management – but this is not a new subject. ‘SMM’ has been the ‘next big thing’ for years. So why, after all this time, is there still so much talk and so little action?
Admittedly there are plenty of reasons offered up:
No clear internal owner to champion the initiative and drive success. The absence of a solution that is easy to deploy, supports broad based adoption AND integrates with the rest of your hotel management strategy. The other perennial favorite, “we don’t really have that many meetings”, is also all too often cited.
These and many other factors contribute to an ‘Ostrich Mentality’: I can’t see it, therefore it isn’t there.
But it IS there and the cost implications of ignoring this category can be huge. Admittedly, you don’t know what you don’t know, but from our own experience the total ‘hospitality’ spend for the majority of organisations is split across 3 areas – 40% on Transient Accommodation, 40% on Meetings and 20% on ad hoc Projects. If your focus is purely on your Transient Accommodation, you are managing less than 50% of your total hotel spend.
So – how difficult can this really be?
You need to understand what your requirement is, so start small. Begin by identifying your target audience. Head for the departments most likely to generate meetings bookings – sales/marketing, training, the executive floor – and ask for volunteers for a ‘super-user’ test team.
At this stage, you want to garner support and not give the impression that you are trying to take away the responsibility for these meetings. All you want is to build the environment where everyone creates their meetings requests (RFPs) in one place. From there you will quickly gather the data you need to put the ‘strategic’ into strategic meetings management.
Aim to start with the small frequently booked meetings. The large conferences and major company events may be the more visible piece but (a) it’s always much tougher to persuade these bookers to give up any aspect of control or management of these bookings and (b) the chances are that you spend much more on smaller meetings. You are offering meeting planners a solution that will take the ‘grunt work’ out of the process without stripping them of ultimate control and the easiest meetings to target for this are the smaller ones – which are usually just a time consuming chore for those that have to book them.
Ask a few basic questions:
Approximately how often do you book? What’s the average size of the group and the length of the meeting? What are the most common features they always need (refreshments, break out rooms, AV equipment etc)? What type of venue do they typically look for (hotels, internal meeting space, other venues)? Where do they go to find these venues and what influences their choice?
The answers will help you build the most useful information and features into your RFP tool so that the first time a meeting planner looks for a venue for a meeting, they find what they expect to see and the basic information is pre-loaded to make it the simpler process that you promised!
So all you now need is a system that all your meeting planners can access with nothing more than a User ID and Password, without any additional implementation, and with just an hour or so training.
And if they like it, if the system gives them access to the properties they need, helps them create an RFP with all their requirements in 4 easy to follow steps, presents the responses in a format they can share with their colleagues, gives them full budgeting and reporting capabilities and allows them to complete the process in a fraction of the time, then you’ve got your ‘champions’ within the organisation and selling the benefits to others will be so much easier.
And finally, the single most important element to consider. The first step on the road to success is always the hardest. As you ponder this article, think about this. What stops you from being the internal champion that gets the ball rolling at your company? Just because you don’t have it in your job description, does that mean you can’t own it? At a time when companies are in a constant process of evaluating people, processes and performance, perhaps the greatest thing you can do for your company and yourself is to take that critical first step.
This blog has been written by Jean Squires, director of business development EMEA, Lanyon. To find out more about how the Lanyon Meetings RFP Tool can help please contact Jean at jean.squires@lanyon.com
GUEST BLOG: A Vision for the Future of Business Travel
Business travel is faster and less isolating than it used to be but, until recently, no-one has been looking out for the business traveller. Now, the landscape is changing and Concur is proud to be a leader in that evolution.
Travel used to be lonely. Gradually, over the past 10 years, and rapidly in the last two, the Internet and mobile devices have changed business travel for the better. Our smartphones now fulfil a dual role of travel buddy and personal assistant. But we still have a steep hill to climb to improve business travel even more.
Self-serve online travel booking enables the business traveller to book travel at a click of a button – but, because no-one is looking at the experience through the eyes of the business traveller, the whole experience is very disjointed and often frustrating. For those that travel across Europe, there’s the added complication of different languages, currencies, procedures and cultures to overcome.
A vision for the future of business travel:
Concur has spent considerable time thinking about what would make ‘The Perfect Trip’. Imagine a journey with no paper or queues, a journey where your smartphone knows your preferences and has pre-booked every step of the journey to seamlessly blend into the next. We have this perfect tripfirmly in mind, and we’re figuring out how to make it happen
How Concur is working to improve business travel:
Making the perfect trip a reality will mean partnership and collaboration between travel suppliers across the entire eco-system for the good of the business traveller. This a huge challenge, particularly in Europe, where suppliers’ regional coverage varies so dramatically. Fortunately, the landscape is already changing and Concur is proud to be a leader in that evolution.
What happens next?
By sharing ideas on how business travel can be improved due to technological integration and the fostering of closer networks we can help shape the future of business travel together. So, whether you are travel supplier, travel app developer, card provider, in the travel business or a business traveller, we’d love to hear your ideas and opinions.
How do you think business travel could be better?
What are your favourite travel apps? What innovations would make the most impact on travel in Europe? These are the kind of questions that will influence the development of a bigger, better travel and expenses management network across Europe. We have made a start by setting up a Facebook community for those that want to contribute or stay in touch with developments. Join us – like us or post your recommendation in the comments below.
Travel used to be lonely. Gradually, over the past 10 years, and rapidly in the last two, the Internet and mobile devices have changed business travel for the better. Our smartphones now fulfil a dual role of travel buddy and personal assistant. But we still have a steep hill to climb to improve business travel even more.
The current reality:
Self-serve online travel booking enables the business traveller to book travel at a click of a button – but, because no-one is looking at the experience through the eyes of the business traveller, the whole experience is very disjointed and often frustrating. For those that travel across Europe, there’s the added complication of different languages, currencies, procedures and cultures to overcome.
A vision for the future of business travel:
Concur has spent considerable time thinking about what would make ‘The Perfect Trip’. Imagine a journey with no paper or queues, a journey where your smartphone knows your preferences and has pre-booked every step of the journey to seamlessly blend into the next. We have this perfect tripfirmly in mind, and we’re figuring out how to make it happenHow Concur is working to improve business travel:
Making the perfect trip a reality will mean partnership and collaboration between travel suppliers across the entire eco-system for the good of the business traveller. This a huge challenge, particularly in Europe, where suppliers’ regional coverage varies so dramatically. Fortunately, the landscape is already changing and Concur is proud to be a leader in that evolution.What happens next?
By sharing ideas on how business travel can be improved due to technological integration and the fostering of closer networks we can help shape the future of business travel together. So, whether you are travel supplier, travel app developer, card provider, in the travel business or a business traveller, we’d love to hear your ideas and opinions.How do you think business travel could be better?
What are your favourite travel apps? What innovations would make the most impact on travel in Europe? These are the kind of questions that will influence the development of a bigger, better travel and expenses management network across Europe. We have made a start by setting up a Facebook community for those that want to contribute or stay in touch with developments. Join us – like us or post your recommendation in the comments below.Written by Lisa Hutt
Lisa heads marketing for Concur Technologies in EMEA and is responsible for growth in the region through brand awareness, pipeline generation and customer success programs. Lisa is an advocate of the latest marketing innovations, global collaboration, sales alignment, lead-to-revenue and influencer marketing. Lisa’s background in marketing communications was developed with IT and online organisations such as Salesforce.com, Dell, Intel, Epson, Sybase and Monster.
Single sign-on to Google sites using AccountManager
In the first part of this series, we presented how the standard Android online account management framework works and explored how Google account authentication and authorization modules are implemented on Android. In this article we will see how to use the Google credentials stored on the device to log in to Google Web sites automatically. Note that this is different from using public Google API's, which generally only requires putting an authentication token (and possibly an API key) in a request header, and is quite well supported by the Google APIs Client Library. First, some words on what motivated this whole exercise (may include some ranting, feel free to skip to the next section).
This lets us authenticate to the Android Developer Console (version 2) site without requiring user credentials and we can easily proceed to parse the result and use it in a native app (warning: work in progress!) from here. The downside is that for this to work, the user has to grant access twice, for two cryptically looking token types (SID and LSID).
Of course, after writing all of this, it turns out that the stock Android browser already has code that does it, which we could have used or at least referenced from the very beginning. Better yet, this find leads us to an yet easier way to accomplish our task.
Android developer console API: DIY
If you have ever published an application on the Android Market Google Play Store, you are familiar with the Android developer console. Besides letting you publish and update your apps, it also shows the number of total and active installs (notoriously broken and not too be taken too seriously, though it's been getting better lately), ratings and comments. Depending on how excited about the whole app publishing business you are, you might want to check it quite often to see how your app is doing, or maybe you just like hitting F5. Most people don't however, so pretty much every developer at some point comes up with the heretic idea that there must be a better way: you should be able to check your app's statistics on your Android device (obviously!), you should get notified about changes automatically and maybe even be able to easily see if today's numbers are better than yesterday's at a glance. Writing such a tool should be fairly easy, so you start looking for an API. If your search ends up empty it's not your search engine's fault: there is none! So before you start scraping those pretty Web pages with your favourite P-language, you check if someone has done this before -- you might get a few hits, and if you are lucky even find the Android app.
Originally developed by Timelappse, and now open source, Andlytics does all the things mentioned above, and more (and if you need yet another feature, consider contributing). So how does it manage to do all of this without an API? Through blood, sweat and a lot of protocolreversing guessing. You see, the current developer console is built on GWT which used to be Google's webstack-du-jour a few years back. GWT essentially consists of RPC endpoints at the server, called by a JavaScript client running in the browser. The serialization protocol in between is a custom one, and the specification is purposefully not publicly available (apparently, to allow for easier changes!?!). It has two main features: you need to know exactly how the transferred objects look like to be able to make any sense of it, and it was obviously designed by someone who used to write compilers for a living before they got into Web development ('string table' ring a bell?). Given the above, Andlytics was quite an accomplishment. Additionally, the developer console changing its protocol every other week and adding new features from time to time didn't really make it any easier to maintain. Eventually, the original developer had a bit too much GWT on his plate, and was kind enough to open source it, so others could share the pain.
But there is a bright side to all this: Developer Console v2. It was announced at this year's Google I/O to much applause, but was only made universally available a couple of weeks ago (sound familiar?). It is a work in progress, but is showing promise. And the best part: it uses perfectly readable (if a bit heavy on
Originally developed by Timelappse, and now open source, Andlytics does all the things mentioned above, and more (and if you need yet another feature, consider contributing). So how does it manage to do all of this without an API? Through blood, sweat and a lot of protocol
But there is a bright side to all this: Developer Console v2. It was announced at this year's Google I/O to much applause, but was only made universally available a couple of weeks ago (sound familiar?). It is a work in progress, but is showing promise. And the best part: it uses perfectly readable (if a bit heavy on
null
's) JSON to transport data! Naturally, there was much rejoicing at the Andlytics Github project. It was unanimously decided that the sooner we obliterate all traces of GWT, the better, and the next version should use the v2 console 'API'. Deciphering the protocol didn't take long, but it turned out that while to log in to the v1 console all you needed was a ClientLogin (see the next section for an explanation) token straight out of Android's AccountManger
, the new one was not so forgiving and the login flow was somewhat more complex. Asking the user for their password and using it to login was obviously doable, but no one would like that, so we needed to figure out how to log in using the Google credentials already cached on the device. Android browser and Chrome are able to automatically log you in to the developer console without requiring your password, so it was clearly possible. The process is not really documented though, and that prompted this (maybe a bit too wide-cast) investigation. Which finally leads us to the topic of this post: to show how to use cached Google account credentials for single sign-on. Let's first see what standard ways are available to authenticate to Google's public services and API's.Google services authentication and authorization
The official place to start when selecting an auth mechanism is the Google Accounts Authentication and Authorization page. It lists quite a few protocols, some open and some proprietary. If you research further you will find that currently all but OAuth 2.0 and Open ID are considered deprecated, and using the proprietary ones is not recommended. However, a lot of services are still using older, proprietary protocols, so we will look into some of those as well. Most protocols also have two variations: one for Web applications and one for the so called, 'installed applications'. Web applications run in a browser, and are expected to be able to take advantage of all standard browser features: rich UI, free-form user interaction, cookie store and ability to follow redirects. Installed applications, on the other hand, don't have a native way to preserve session information, and may not have the full Web capabilities of a browser. Android native applications (mostly) fall in the 'installed applications' category, so let's see what protocols are available for them.
ClientLogin
The oldest and most widely used till now authorization protocol for installed applications is ClientLogin. It assumes the application has access to the user's account name and password and lets you get an authorization token for a particular service, that can be saved and used for accessing that service on behalf of the user. Services are identified by proprietary service names, for example 'cl' for Google Calendar and 'ah' for Google App engine. A (non-exhaustive) list of supported service names can be found in the Google Data API reference. Here are a few Android-specific ones, not listed in the reference: 'ac2dm', 'android', 'androidsecure', 'androiddeveloper', 'androidmarket' and 'youngandroid' (probably for the discontinued App Inventor). The token can be fairly long-lived (up to two weeks), but cannot be refreshed and the application needs to obtain a new token when it expires. Additionally, there is no way to validate the token short of accessing the associated service: if you get an OK HTTP status (200), it is still valid, if 403 is returned you need to consult the additional error code and retry or get a new token. Another limitation is that ClientLogin tokens don't offer fine grained access to a service's resources: access is all or nothing, you cannot specify read-only access or access to a particular resource only. The biggest drawback for use in mobile apps though is that ClientLogin requires access to the actual user password. Therefore, if you don't want to force users to enter it each time a new token is required, it needs to be saved on the device, which poses various problems. As we saw in the previous post, in Android this is handled by GLS and the associated online service by storing an encrypted password or a master token on the device. Getting a token is as simple as calling the appropriateAccountManger
method, which either returns a cached token or issues an API request to fetch a fresh one. Despite it's many limitations, the protocol is easy to understand and straightforward to implement, so it has been widely used. It has been officially deprecated since April 2012 though, and apps using it are encouraged to migrate to OAuth 2.0, but this hasn't quite happened yet. OAuth 2.0
No one likes OAuth 1.0 (except Twitter) and AuthSub is not quite suited for native applications, so we will only look at the currently recommended OAuth 2.0 protocol. OAuth 2.0 has been in the works for quite some time, but it only recently became an official Internet standard. It defines different authorization 'flows', aimed at different use cases, but we will not try to present all of them here. If you are unfamiliar with the protocol, refer to one of the multiple posts that aim to explain it at a higher level, or just read the RFC if you need the details. And, of course, you can watch for this for a slightly different point of view. We will only discuss how OAuth 2.0 relates to native mobile applications.
The OAuth 2.0 specification defines 4 basic flows for getting an authorization token for a resource, and the two ones that don't require the client (in our scenario an Android app) to directly handle user credentials (Google account user name and password), namely the authorization code grant flow and the implicit grant flow, both have a common step that needs user interaction. They both require the authorization server (Google's) to authenticate the resource owner (the user of the our Android app) and establish whether they grant or deny the access request for the specified scope (e.g., read-only access to profile information). In a typical Web application that runs in a browser, this is very straightforward to do: the user is redirected to an authentication page, then to a access grant page that basically says 'Do you allow app X to access data Y and Z?', and if they agree, another redirect, which includes an authorization token, takes them back to the original application. The browser simply needs to pass on the token in the next request to gain access to the target resource. Here's an official Google example that uses the implicit flow: follow this link and grant access as requested to let the demo Web app display your Google profile information. With a native app things are not that simple. It can either
Now that we have an idea what authentication methods are available, let's see if we can use them to access an online Google service that doesn't have a dedicated API.
Logging in using
The OAuth 2.0 specification defines 4 basic flows for getting an authorization token for a resource, and the two ones that don't require the client (in our scenario an Android app) to directly handle user credentials (Google account user name and password), namely the authorization code grant flow and the implicit grant flow, both have a common step that needs user interaction. They both require the authorization server (Google's) to authenticate the resource owner (the user of the our Android app) and establish whether they grant or deny the access request for the specified scope (e.g., read-only access to profile information). In a typical Web application that runs in a browser, this is very straightforward to do: the user is redirected to an authentication page, then to a access grant page that basically says 'Do you allow app X to access data Y and Z?', and if they agree, another redirect, which includes an authorization token, takes them back to the original application. The browser simply needs to pass on the token in the next request to gain access to the target resource. Here's an official Google example that uses the implicit flow: follow this link and grant access as requested to let the demo Web app display your Google profile information. With a native app things are not that simple. It can either
- use the system browser to handle the permission grant step, which would typically involve the following steps:
- launch the system browser and hope that the user will finish the authentication and permission grant process
- detect success or failure and extract the authorization token from the browser on success (from the window title, redirect URL or the cookie store)
- ensure that after granting access, the user ends up back in your app
- finally, save the token locally and use it to issue the intended Web API request
- embed a
WebView
or a similar control in the apps's UI. Getting a token would generally involve these steps: - in the app's UI, instruct the user what to do and load the login/authorization page
- register for a 'page loaded' callback, and check for the final success URL each time it's called
- when found, extract the token from the redirect URL or the
WebView
's cookie jar and save it locally - finally use the token to send the intended API request
redirect_uri
is set to http://localhost
in the API console, so you can't just use a custom scheme). The second one is generally preferable, if not pretty: here's an (somewhat outdated) overview of what needs to be done and a more recent example with full source code. This integration complexity and UI impedance mismatch are the problems that OAuth 2.0 support via the AccountManager
initially, and recently Google Play Services aim to solve. When using either of those, user authentication is implemented transparently by passing the saved master token (or encrypted password) to the server side component, and instead of a WebView
with a permission grant page, you get the Android native access grant dialog. If you approve, a second request is sent to convey this and the returned access token is directly delivered to the requesting app. This is essentially the same flow as for Web applications, but has the advantages that it doesn't require context switching from native to browser and back, and is much more user friendly. Of course, it only works for Google accounts, so if you wanted to write, say, a Facebook client, you still have to use a WebView
to process the access permission grant and get an authorization token.Now that we have an idea what authentication methods are available, let's see if we can use them to access an online Google service that doesn't have a dedicated API.
Google Web properties single sign-on
Being able to access multiple related, but separate services without needing to authenticate to each one individually is generally referred to as single sign-on (SSO). There are multiple standard ways to accomplish this for different contexts, ranging from Kerberos to SAML-based solutions. We will use the term here in a narrower meaning: being able to use different Google services (Web sites or API's) after having authenticated to only one of them (including the Android login service). If you have a fairly fast Internet connection, you might not even notice it, but after you log in to, say, Gmail, clicking on YouTube links will take you to a completely different domain, and yet you will be able to comment on that neat cat video without having to log in again. If you have a somewhat slower connection and a wide display though, you may notice that there is a lot of redirecting and long parameter passing, with the occasional progress bar going on. What happens behind the scenes is that your current session cookies and authentication tokens are being exchanged for yet other tokens and more cookies, to let you seamlessly log in to that other site. If you are curious, you can observe the flow with Chrome's built-in developer tools (or similar plugins for other browsers), or check out our sample. All of those requests and responses are essentially a proprietary SSO protocol (Google's), which is not really publicly documented anywhere, and, of course, is likely to change fairly often as Google rolls out upgrades to their services. With that said, there is a distinct pattern, and on a higher level you only have two main cases. We are deliberately ignoring the persistent cookie ('Stay signed in') scenario for simplicity's sake.
- Case 1: you haven't authenticated to any of the Google properties. If you access, for example,
mail.google.com
in that state you will get a login screen originating athttps://accounts.google.com/ServiceLogin
with parameters specifying the service you are trying to access ('mail' for Gmail) and where to send you after you are authenticated. After you enter your credentials, you will generally get redirected a few times around theaccounts.google.com
, which will set a few session cookies, common (Domain=.google.com
) for all services (always SID and LSID, plus a few more). The last redirect will be to the originally requested service and include an authentication token in the redirected location (usually specified with theauth
parameter, e.g.:https://mail.google.com/mail/?auth=DQAAA...
). The target service will validate the token and set a few more service-specific sessions cookies, restricted by domain and path, and with theSecure
andHttpOnly
flags set. From there, it might take a couple of more redirects before you finally land at an actual content page. - Case 2: you have already authenticated to at least one service (Gmail in our example). In this state, if you open, say, Calendar, you will go through
https://accounts.google.com/ServiceLogin
again, but this time the login screen won't be shown. The accounts service will modify your SID and LSID cookies, maybe set a few new ones and finally redirect you the original service, adding an authentication token to the redirect location. From there the process is similar: one or more service-specific cookies will be set and you will finally be redirected to the target content.
Those flows obviously work well for browser-based logins, but since we are trying to do this from an Android app, without requiring user credentials or showing WebView's, we have a different scenario. We can easily get a ClientLogin or an OAuth 2.0 token from the AccountManager, but since we are not preforming an actual Web login, we have no cookies to present. The question becomes: is there a way to log in with a standard token alone? Since tokens can be used with the data APIs (where available) of each service, they obviously contain enough information to authenticate us and grant access to the service's resources. What we need is an Web endpoint, that will take our token and give us a set of cookies we could use to access the corresponding Web site in exchange. Clues and traces of such a service are scattered around the Internet, mostly in the code of unofficial Google client libraries and applications. Once we know it is definitely possible, the next problem becomes getting it to work with Android's AccountManger.
Logging in using AccountManager
The only real documentation we could find, besides code comments and READMEs of the unofficial Google client applications mentioned above, is a short Chromium OS design document. It tells us that the standard (at the time) login API for installed applications, ClientLogin, alone is not enough to accomplish Web SSO, and outlines a three step process that lets us exchange ClientLogin tokens for session cookies valid for a particular service:
- Get a ClientLogin token (this we can do via the
AccountManager
) - Pass it to
https://www.google.com/accounts/IssueAuthToken
, to get a one-time use, short-lived token that will authenticate the user to any service (the so called, 'ubertoken') - Finally, pass the ubertoken to
https://www.google.com/accounts/TokenAuth
, to exchange it for the full set of browser cookies we need to do SSO
- To get the mythical ubertoken, you need to pass the SID and LSID cookies to the
IssueAuthToken
endpoint like this:https://www.google.com/accounts/IssueAuthToken?service=gaia&Session=false&SID=sid&LSID=lsid
- The response will give you the ubertoken, which you pass to the
TokenAuth
endpoint along with the URL of the service you want to use:https://www.google.com/accounts/TokenAuth?source=myapp&auth=ubertoken&continue=service-URL
- If the token check out OK, the response will give you a URL to load. If your HTTP client is set up to follow redirects automatically, once you load it, needed cookies will be set automatically (just as in a browser), and you will finally land on the target site. As long as you keep the same session (which usually means the same HTTP client instance) you will be able to issue multiple requests, without needing to go through the authentication flow again.
What remains to be seen is, can we implement this on Android. As usual, it turns out that there is more than one way to do it:
The hard way
The straightforward way would be to simply implement the flow outlined above using your favourite HTTP client library. We choose to use Apache HttpClient, which supports session cookies and multiple requests using a single instance out of the box. The first step calls for the SID and LSID cookies though, not an authentication token: we need cookies to get a token, in order to get more cookies. Since Android's
Having gotten those, the rest is just a matter of issuing two HTTP requests (error handling omitted for brevity):
AccountManager
can only give us authentication tokens, and not cookies, this might seem like a hopeless catch-22 situation. However, while browsing the authtokens
table of the system's accounts database earlier, we happened to notice that it actually had a bunch of tokens with type SID
and LSID
. Our next step is, of course, to try to request those tokens via the AccountManager
interface, and this happens to work as expected:String sid = am.getAuthToken(account, "SID", null, activity, null, null)
.getResult().getString(AccountManager.KEY_AUTHTOKEN);
String lsid = am.getAuthToken(account, "LSID", null, activity, null, null)
.getResult().getString(AccountManager.KEY_AUTHTOKEN);
Having gotten those, the rest is just a matter of issuing two HTTP requests (error handling omitted for brevity):
String TARGET_URL = "https://play.google.com/apps/publish/v2/";
Uri ISSUE_AUTH_TOKEN_URL =
Uri.parse("https://www.google.com/accounts/IssueAuthToken?service=gaia&Session=false");
Uri TOKEN_AUTH_URL = Uri.parse("https://www.google.com/accounts/TokenAuth");
String url = ISSUE_AUTH_TOKEN_URL.buildUpon().appendQueryParameter("SID", sid)
.appendQueryParameter("LSID", lsid)
.build().toString();
HttpPost getUberToken = new HttpPost(url);
HttpResponse response = httpClient.execute(getUberToken);
String uberToken = EntityUtils.toString(entity, "UTF-8");
String getCookiesUrl = TOKEN_AUTH_URL.buildUpon()
.appendQueryParameter("source", "android-browser")
.appendQueryParameter("auth", authToken)
.appendQueryParameter("continue", TARGET_URL)
.build().toString();
HttpGet getCookies = new HttpGet(getCookiesUrl);
response = httpClient.execute(getCookies);
CookieStore cookieStore = httpClient.getCookieStore();
// check for service-specific session cookie
String adCookie = findCookie(cookieStore.getCookies(), "AD");
// fail if not found, otherwise get page content
String responseStr = EntityUtils.toString(entity, "UTF-8");
This lets us authenticate to the Android Developer Console (version 2) site without requiring user credentials and we can easily proceed to parse the result and use it in a native app (warning: work in progress!) from here. The downside is that for this to work, the user has to grant access twice, for two cryptically looking token types (SID and LSID).
Of course, after writing all of this, it turns out that the stock Android browser already has code that does it, which we could have used or at least referenced from the very beginning. Better yet, this find leads us to an yet easier way to accomplish our task.
The easy way
The easy way is found right next to the Browser class referenced above, in the DeviceAccountLogin class, so we can't really take any credit for this. It is hardly anything new, but some Googling suggests that it is neither widely known nor used much. You might have noticed that the Android browser is able to silently log you in to Gmail and friends, when you use the mobile site. The way this is implemented is via the 'magic' token type
Here's how to get the
This is again for the Developer Console, but works for any Google site, including Gmail, Calendar and even the account management page. The only problem you might have is finding the service name, which is hardly obvious in some cases (e.g., 'grandcentral' for Google Voice and 'lh2' for Picasa).
It takes only a single HTTP request form Android to get the final URL, which tells us that the token issuing flow is implemented on the server side. This means that you can also use the Google Play Services client library to issue a
As we mentioned above, this is all ClientLogin based, which is officially deprecated, and might be going away soon (EOL scheduled for April 2013). But some of the Android Google data sync feeds still depend on ClientLogin, so if you use it you would probably OK for a while. Additionally, since the
Moral of the story: interoperability is so much easier when you control all parties involved.
'weblogin:'
. If you use it along with the service name and URL of the site you want to access, it will do all of the steps listed above automatically and instead of a token will give you a full URL you can load to get automatically logged in to your target service. This magic URL is in the format shown below, and includes both the ubertoken and the URL of the target site, as well as the service name (this example is for the Android Developer Console, line is broken for readability):https://accounts.google.com/MergeSession?args=service%3Dandroiddeveloper%26continue
%3Dhttps://play.google.com/apps/publish/v2/&uberauth=APh...&source=AndroidWebLogin
Here's how to get the
MergeSession
URL:String tokenType = "weblogin:service=androiddeveloper&"
+ "continue=https://play.google.com/apps/publish/v2/";
String loginUrl = accountManager.getAuthToken(account,tokenType, false, null, null)
.getResult().getString(AccountManager.KEY_AUTHTOKEN);
This is again for the Developer Console, but works for any Google site, including Gmail, Calendar and even the account management page. The only problem you might have is finding the service name, which is hardly obvious in some cases (e.g., 'grandcentral' for Google Voice and 'lh2' for Picasa).
It takes only a single HTTP request form Android to get the final URL, which tells us that the token issuing flow is implemented on the server side. This means that you can also use the Google Play Services client library to issue a
weblogin:
'token' (see screenshot below and note that unlike for OAuth 2.0 scopes, it shows the 'raw' token type). Probably goes without saying, but it also means that if you happen to come across someone's accounts.db
file, all it takes to log in into their Google account(s) is two HTTPS requests: one to get the MergeSession
URL, and one to log in to their accounts page. If you are thinking 'This doesn't affect me, I use Google two-factor authentication (2FA)!', you should know that in this case 2FA doesn't really help. Why? Because since Android doesn't support 2FA, to register an account with the AccountManager
you need to use an application specific password (Update: On ICS and later, GLS will actually show a WebView and let you authenticate using your password and OTP. However, the OTP is not required once you get the master token). And once you have entered one, any tokens issued based on it, will just work (until you revoke it), without requiring entering an additional code. So if you value your account, keep your master tokens close and revoke them as soon as you suspect that your phone might be lost or stolen. Better yet, consider a solution that lets you wipe it remotely (which might not work after your revoke the tokens, so be sure to check how it works before you actually need it).As we mentioned above, this is all ClientLogin based, which is officially deprecated, and might be going away soon (EOL scheduled for April 2013). But some of the Android Google data sync feeds still depend on ClientLogin, so if you use it you would probably OK for a while. Additionally, since the
weblogin:
implementation is server-based, it might be updated to conform with the latest (OAuth 2.0-based?) infrastructure without changing the client-side interface. In any case, watch the Android Browser and Chormium code to keep up to date.Summary
Google offers multiple online services, some with both a traditional browser-based interface and a developer-oriented API. Consequently, there are multiple ways to authenticate to those, ranging from form-based username and password login to authentication API's such as ClientLogin and OAuth 2.0. It is relatively straightforward to get an authentication token for services with a public API on Android, either using Android's nativeAccountManager
interface or the newer Google Play Services extension. Getting the required session cookies to login automatically to the Web sites of services that do not offer an API is however neither obvious, nor documented. Fortunately, it is possible and very easy to do if you combine the special 'weblogin:'
token type with the service name and the URL of the site you want to use. The best available documentation about this is the Android Browser source code, which uses the same techniques to automatically log you in to Google sites using the account(s) already registered on your device.Moral of the story: interoperability is so much easier when you control all parties involved.
Veterans Day Freebie
Veterans Day holds a special place in my heart every year. Read below... I'm RE-POSTING an "oldie, but goodie" blog post from last year. I added a FREEBIE to go with it! Enjoy and Happy Veterans Day!
If you're looking for a cool, meaningful volunteer or service project to do with your students, consider "adopting a soldier" who is currently serving overseas. My classes and I for the last several years have adopted at least 10 soldiers stationed in Afghanistan and Iraq. "Adopting" a soldier consists of making the commitment to send one letter a week and one care package a month to someone on active duty. (Which is easy when you have 20 some eager students ready to write their letter!) My students and I have made some great friends, encouraged someone is serving our country, and participated in some of the most amazing events through this adoption.
How do you "adopt" a soldier? You sign up with the non-profit organization called Soldiers Angels.
After they give you clearance, they will assign you a soldier and give you his/her address overseas and you're ready to go! Who says the academics have to take a back seat? I teach my parts of a friendly letter, map skills, addressing an envelope, focusing on common/proper nouns, some history, and of course, citizenship and volunteering. I'd love to say that all my soldiers have been actively involved in the process of writing back to us faithfully, but that's not the case. I've had everything from no letters in return because they're just too busy, to other soldiers who write us back faithfully. I've even had one show up for a visit on Veterans Day the following year he returned from active duty. Last year my students got to be involved in a soccer ball drive with our soldier. He wanted us to collect soccer balls to send to him overseas where he distributed to the local village children in Basrah, Iraq. The whole "adoption" process has been a WIN/WIN for everyone involved. Enjoy some photos from some of our FAVORITE moments.
Some very excited 3rd graders collecting
soccer balls for a good cause
We were lucky enough to have one of our
adopted soldiers come VISIT us on Veterans Day!
He presented our class with a certificate of appreciation,
coins from his platoon, and a flag flown over their
camp in our honor while he was stationed in Iraq.
As always, if you would like some additional information or are interested in getting started, just let me know! I'll help in any way I can!
Click on the image to grab your FREEBIE Veterans Day timeline.
Bananas for those that serve and sacrifice for our freedom,
If you're looking for a cool, meaningful volunteer or service project to do with your students, consider "adopting a soldier" who is currently serving overseas. My classes and I for the last several years have adopted at least 10 soldiers stationed in Afghanistan and Iraq. "Adopting" a soldier consists of making the commitment to send one letter a week and one care package a month to someone on active duty. (Which is easy when you have 20 some eager students ready to write their letter!) My students and I have made some great friends, encouraged someone is serving our country, and participated in some of the most amazing events through this adoption.
How do you "adopt" a soldier? You sign up with the non-profit organization called Soldiers Angels.
After they give you clearance, they will assign you a soldier and give you his/her address overseas and you're ready to go! Who says the academics have to take a back seat? I teach my parts of a friendly letter, map skills, addressing an envelope, focusing on common/proper nouns, some history, and of course, citizenship and volunteering. I'd love to say that all my soldiers have been actively involved in the process of writing back to us faithfully, but that's not the case. I've had everything from no letters in return because they're just too busy, to other soldiers who write us back faithfully. I've even had one show up for a visit on Veterans Day the following year he returned from active duty. Last year my students got to be involved in a soccer ball drive with our soldier. He wanted us to collect soccer balls to send to him overseas where he distributed to the local village children in Basrah, Iraq. The whole "adoption" process has been a WIN/WIN for everyone involved. Enjoy some photos from some of our FAVORITE moments.
The soccer ball drive was on the news and in a military publication. My students were so proud that they helped get 200 soccer balls delivered to such eager children in Iraq. |
Some very excited 3rd graders collecting
soccer balls for a good cause
We were lucky enough to have one of our
adopted soldiers come VISIT us on Veterans Day!
He presented our class with a certificate of appreciation,
coins from his platoon, and a flag flown over their
camp in our honor while he was stationed in Iraq.
As always, if you would like some additional information or are interested in getting started, just let me know! I'll help in any way I can!
Click on the image to grab your FREEBIE Veterans Day timeline.
Bananas for those that serve and sacrifice for our freedom,
GUEST BLOG: How are businesses cutting costs whilst improving productivity?
Thousands of organisations are focused on cutting costs, but how are they able to do so whilst maintaining, and even improving productivity?
Millions of us are afraid of change, which makes many of us averse to using new technology, especially in the workplace. But the proven fact is new technology in the workplace is the main contributor of cutting costs, improving productivity, and even speeding up the decision making process.
Business magnate, Richard Branson, recently quoted: “Anyone who thinks new technology isn’t going to keep changing the world has got their head in the sand.” I know what many of you are thinking: Richard Branson is a multi-billionaire, and for him the initial cost of implementing new technology into the workplace is a mere drop in the ocean.
For business owners and budget handlers, yes new technology can be costly, and no it’s extremely unlikely you’ll generate an ROI within the first six to twelve months. But even in these tough economic times, is your business roadmap really only twelve months? If you are just ‘ticking along’ and your capital expenditure has halted, it is definitely time to get your head out of the sand. If you are not prepared to invest in new collaborative technology solutions, then you best stop aspiring to be successful. Sound harsh? It is, but it’s the truth!
So what technology are businesses using to cut costs?
One area businesses are focused on is travel expenditure. Fuel, accommodation, flights, etc. How do businesses reduce travel expenditure and remain productive? Now you’ll be forgiven for turning your head away when you read the words “Video conferencing”. Perhaps those words will remind you of a meeting many years ago when you participated in a video call which was visually and audibly poor. You left the room thinking “I hope I never have to take part in a video call ever again.” Well as some of you will have already experienced, video conferencing technology is now a must have business tool and has been deployed across thousands of organisations. Bandwidth restrictions are less challenging, and face-to-face video communication is now delivered in high definition.
Organisations are using the technology for internal and external communication. Rather than travelling five hundred miles for a meeting, of which 90% of the time spent traveling is non-productive and incurs fuel and accommodation costs, businesses are choosing to conduct meetings over video. Both time and money is saved, and it causes little disruption to an individual’s working day.
Businesses are communicating with clients, partners and suppliers over video. Many of the most successful organisations will refuse to develop partnerships unless each party has adopted the use of video collaboration technology. It’s more personal and up to 70% more productive than a telephone call, mainly a result of facial expressions and hand gestures.
Video communication is more affordable than ever with desktop and cloud based offerings, which cause little strain on IT departments as well as offer interoperability, which ensures face-to-face communication between two or more people irrespective of video device.
Cost-cutting for your business takes serious consideration, as does devising a business development plan. However failing to include collaborative technology in your development plan may as well be a plan to fail.
This guest blog has been written by Joel Noden who is marketing manager at Business Travel Show exhibitor Videonations Ltd. www.videonations.com
Langganan:
Postingan (Atom)