Evernote Tech Blog

The Care and Feeding of Elephants

FreeRADIUS + OpenLDAP TOTP Part 2

Earlier we discussed our selection of FreeRADIUS + OpenLDAP to do TOTP. Now for the good part: how this system is setup. As mentioned earlier, we use LDAP as the general data store for user information. Since LDAP is traditionally used as an authentication store, it already has many of the security controls needed to keep the TOTP secrets secure. It can also perform the first factor of user/password-based authentication. The changes done to LDAP to support this method are minimal. First, an attribute is needed to store the TOTP secret for each user, possibly a second to tell the provisioning system if TOTP is allowed for the user. It’s best to use an attribute specific to this purpose, creating a schema for it if possible (there are several easily found online). For this example we will use an attribute we will call “totpSecret.” Create an LDAP account specifically for running the TOTP authentication, and one for the provisioning system if there isn’t one doing this already. Create a new LDAP ACL, restricting access to the chosen attribute so that only these two users can do anything with it. Example:

to attrs=totpSecret by dn.base="cn=totpprovisioner,dc=example,dc=com" write by
dn.base="cn=totpauthenticator,dc=example,dc=com" read by * none

With the basic security items in place and ready, we set up FreeRADIUS.

  1. apt-get install freeradius freeradius-ldap (allow it to install the needed dependencies)
  2. Create a Perl script, totp.pl, that contains the TOTP verification algorithm. An example is up on Evernote’s Github. If you use the sample code, be sure to understand what it is doing, and edit it to fit your environment
  3. Enable rlm_ldap, the new TOTP script and rlm_perl, and make FreeRADIUS call it for auth.
    1. Edit modules/perl and point it to use the totp.pl script.
    2. Edit modules/ldap and set it up to work with your LDAP server (be sure your SSL certs are in place and working!)
    3. In the sites_enabled/*, uncomment the LDAP line in the Authorization section and add TOTP to the Authentication section (just under the similar-looking LDAP block) like so:
      Auth-Type TOTP {
         perl
      }
    4. Finally, for FreeRADIUS to actually call TOTP, add a line to users.conf (other criteria can be added to filter who/what uses TOTP):
      DEFAULT Auth-Type := TOTP; Fall-Through = No
  4. Edit the rc or init script for FreeRADIUS to load the Perl libraries it will need. To do this, just add LD_PRELOAD=/usr/lib/libperl.so.5.10 to the startup script line that starts FreeRADIUS (change to your Perl library version if different).
  5. Make sure your clients file has a section for your host or subnet and has a secret set.
  6. Launch FreeRADIUS in debug mode (which is VERY useful to get it working). Change to match your Perl library as necessary:
    LD_PRELOAD=/usr/lib/libperl.so.5.10 freeradius -X

Watch the console to see if FreeRADIUS fails to start. It should give you a good idea where to go to fix things. Once it starts cleanly, you should be able to test provisioned users with the radtest utility: radtest $username $password Localhost 1234 $Secret where $password will be passed into the perl script for validation, 1234 is a made-up port number and $Secret is the radius secret for Localhost, which by default is “testing123”.

Tagged , , , , , , | Leave a comment

Evernote @ AngelHack Silicon Valley

logo

Developers and designers from the Evernote team will be attending AngelHack Silicon Valley this weekend, and we want you to join us. Come to the PayPal HQ in San Jose, where the Evernote team will present about our API. In addition, the team that builds the best Evernote integration will win Nexus 7 tablets! We want you to join us in San Jose this weekend, and we’ve put together some resources for you to get started.

Getting Started with the Evernote API

We are proud to have a public API that allows any developer to work with our robust platform. Evernote aims to help you remember everything, but we cannot do that entirely on our own. We therefore look to you, the developer community, to bring exciting new features to the Evernote experience.

We have already compiled the resources you need to successfully develop with Evernote. Check out our developer homepage, where you can read through our Quick Start Guides for every platform. Or, read through our Hackthon How-To, which is your guide to working with Evernote for the weekend. In addition, check out our YouTube channel, where we have recordings from past developer workshops

Prizes & Opportunities

Our team will be ready with some great opportunities for those who work with Evernote. The team we judge to build the best Evernote integration will win free Nexus 7 tablets!

In addition, we encourage all Evernote integrations to submit to Devcup 2013. Our annual developer competition, Devcup works to reward developers who build unique apps that integrate with Evernote. Winners can earn up to $20,000 in prizes and become part of the new Evernote Accelerator, a program that will provide resources and mentorship to help teams build their apps into successful, standalone products.

Reach Out!

Come talk to us, we don’t bite. In fact, we are eager to work with the talented individuals who will help enhance the future of Evernote. We’re always live on the forums ready to answer questions you might have. Or, reach out to us on Facebook and Twitter.

We’re proud to be an AngelHack sponsor, and we can’t wait to see you there!

The Evernote Developer Team

Leave a comment

FreeRADIUS + OpenLDAP Based TOTP Part 1

Two-factor authentication (also known as two-step verification or 2FA) is essentially a must-have these days for critical infrastructure. The benefits and reasons why are well documented on our recent blog posts and elsewhere around the internet. Here at Evernote Operations, we have been using it to protect our production back-end for well over a year now. Recently, we were tasked with further hardening some of our internal non-production infrastructure. Part of this hardening included requiring 2FA to access certain systems to which many of our non-operations staff would need access. To accomplish this, we evaluated a number of systems and methods, commercial and Free Open Source Software (FOSS), for a secure solution that would provide a true second factor of authentication and support the devices and software needed by our internal users. It also needed to be easy to manage, monitor, maintain, and provision. We felt the solution we selected should be shared with the community. It is fairly easy to setup, uses all FOSS, and performs the authentication using a protocol that almost any system or device can use.

We selected a solution based on TOTP (RFC-6238). This method uses time-based codes generated by a hardware or software token to provide the 2nd factor of auth, and is the same RFC already used by many large web companies. In fact, it is the same RFC followed for our own customer facing two-step verification solution. To get a little more detailed in how this method works: it takes the Unix epoch timestamp (time in seconds from January 1, 1970) and divides by the time interval the code will be good for (typically 30 or 60 seconds). This is then used as the increment counter for HOTP (RFC-4226). HOTP uses a shared secret seed (unique to each account) and the counter as input to some hashing algorithms that output a short 6-digit code. The employee enters the code as part of their password during login, which the authenticating server strips out and compares it to its own calculation of what it should be. The password is then sent on to other authentication sources for verification. Since the code changes at the end of each time interval, it is impossible to login to an employee’s account simply by knowing one code.

Our solution uses FreeRADIUS as the authentication server and OpenLDAP as the storage backend. FreeRADIUS has a modular setup allowing various authentication, authorization, and accounting modules to be plugged in for different authenticating hosts. This allows for setting up a single server that can do complex WiFi auth (e.g. incantations of PEAP/EAP) for some devices and simple PAP auth for others. It has modules to tie it directly into LDAP, and can even do XLAT, where it runs LDAP queries to fill out configuration items. OpenLDAP is generally the de facto LDAP server on Linux, though any LDAP server should work.

The key to this system is FreeRADIUS’s modularity, specifically the Perl module it comes with. This allows writing any authorization, authentication, accounting, and auditing (AAAA) rules into a Perl script. We took the example Perl script from the rlm_perl documentation and added in a TOTP verification function, using LDAP to pull some critical data (employee’s TOTP secret) and voilà: instant 2-factor. In all honesty it isn’t quite that simple. There are a good handful more steps and configuration changes and tweaks to get it working correctly and securely, but for standing up your own 2-factor system it was quick and almost as painless as a commercial system we use (but beats it hands down for flexibility). More details to come!

Leave a comment

API Workshops Now Available

Last month, Evernote developers and designers traveled to Bogotá, Colombia to connect with the talented developer community for two Evernote technical workshops. The Evernote API team led a series of master classes that covered all aspects of building apps that sync with the Evernote Cloud Platform. The design team reviewed criteria for building memorable apps. Now, recordings of these workshops along with the presentation materials are available for our entire developer community!

Evernote API Workshops

Evernote has a free, public API that allows any developer to tap into our services. Through our API, your apps can access a users account to create and access notes. Our Bogotá workshops covered the core of the Evernote platform, including our mobile SDKs and working with Evernote on the web.

At Evernote, we enjoy working with unique apps that stand out on their own. In Bogotá, we also highlighted how to reach this goal: an app with its own, unique brand.  Our workshops cover both the design principles that make an app distinct and how we work to promote partners to success.

Scroll to the end of this post for a list of the talks given.

Devcup and Beyond

devcup_614_banner1

These workshops also serve as your resource for Devcup success. Our annual developer competition, Devcup awards prizes and resources to the best Evernote compatible apps submitted. From design principles to development guidelines, this series depicts what we look for in the Devcup submissions.

We are here to help you succeed. If you have more questions, check out the Evernote Developers homepage for more resources about the Evernote API. Browse our forums for advice from an active developer community. Or, reach out to us directly on Twitter or Facebook.

We hope these Evernote API workshops will aid you in your development endeavors. Check back soon for even more resources on how to make great Evernote compatible apps!

Intro to Evernote for Developers - Chris Traganos

Slides [PDF]

Overview of the Evernote API - Mustafa Furniturewala

Slides [PDF]

Intro to Evernote on the Web - Mustafa Furniturewala

Slides [PDF]

Design Workshop for Developers - Chris Traganos

Slides [PDF]

Android & iOS Code Walkthrough - Mustafa Furniturewala

Developer Promotion at Evernote - Chris Traganos

Slides [PDF]

The Evernote Developer Relations Team

Leave a comment

Devcup 2013 – Two Weeks Left!

Evernote DevcupThere are now only two weeks left to submit your apps to Devcup 2013! Our annual competition to highlight the best Evernote compatible apps that you can make, Devcup gives you the chance to win prizes and resources to help you continue your work. Submissions are due by 11:59 PM on June 28th, and the information below will help you get there.

Partners and Prizes Galore

new_devcup_partners

This year we are proud to work with a number of partners who have helped provide new resources for Devcup participants. Honda Silicon Valley Lab, the high-tech research and development arm of Honda, has joined us as a worldwide partner for our development program. All Devcup participants have access to Honda’s new Vehicle API, and the team judged to have built the best integration will win the special Honda Innovation Award.

Another of our sponsors, Amazon Web Services Startups, has also provided generous resources for participating developers. Any developer who submits an app to Devcup will be awarded a $100 AWS credit to help host the apps built.

Guidelines and Extra Help

We want to see apps that stand out. So, we have put together a best practices guide that offers advice on how to create unique and definitive apps. Part of this process is the video demo due at the app submission deadline. The video is your chance to pitch your app and convince our judges that you deserve to move on to round two. As with any pitch, this takes concentrated effort. We expect videos that are concise, well edited, and persuasive.

Help Is Always There!

Not only do we anticipate great submissions, but we want to help you get to the finish line. Be sure to browse the Evernote Developers homepage, which is your source for information about working with the Evernote API. We’re also available to talk directly. Visit us on the developer and Devcup forums. Or, reach out to us on Twitter. And finally, don’t forget to read through the official competition rules!

Good luck. We’re ready to be wowed!

The Evernote Developer Team

Leave a comment

Honda Vehicle API Now Available

hsvl

In the past several months, we have partnered with Honda Silicon Valley Lab to provide our developer community with new opportunities. As a sponsor of Devcup 2013 and the Evernote Accelerator, Honda SVL is helping developers produce the next generation of Evernote compatible apps.

Today, we are happy to announce another great resource for Evernote developers: open access to Honda’s new Vehicle API.  All those with a registered Evernote API key can now work directly with the Vehicle API in all their development endeavors!

The Vehicle API

Currently in beta, Honda’s Vehicle API allows developers to access a host of vehicle data logged from a car’s internal network. The Vehicle API works to enhance any travel focused app, allowing users to interact with useful driving data in real time. At our recent Design & Build Weekend here at the Evernote HQ, participating developers were able to create the first round of apps that tap into this network of information.  For inspiration, we recommend you browse some of these hacks, such as this running demo created by our very own Kentaro Suzuki. We’re excited to now open this access to the remainder of our developer community!

Get Your Vehicle API Key Today

If you are an Evernote developer and would like to work with the Vehicle API, it’s yours for the taking. Through a few easy steps, you can start innovating.

Step 1 – Register for an Evernote API Key 

If you already have an Evernote API key, great–you can move to step 2. If not, getting an Evernote API Key is simple. Navigate to the Evernote Developers homepage, and click “Get An API Key” in the top right corner. Fill out the appropriate information and click “Request Key.” You can also continue to explore the Evernote Developers homepage for a host of useful resources and guides.

step1

Step 2 – Register for Access to the Vehicle API

Once you have an Evernote API key, you can head over to Honda SVL’s API portal. There, fill in all the required information, as well as your API consumer key. Once your request has been approved, you will soon receive an email with a copy of your Vehicle API key. From there, happy hacking!

step2

Devcup 2013 and Beyond

This partnership with Honda SVL fits perfectly with Devcup 2013. As developers from around the world race to build the next generation of Evernote compatible apps, we encourage participants to integrate Honda’s Vehicle API into their projects. In addition, the Devcup team with the best Vehicle API integration will win the Honda Innovation Prize as a recognition for their innovative work.

But, this exclusive partnership will provide Evernote developers with long standing opportunity as well. As of today, any Evernote developer can beta test the Vehicle API and work towards a more efficient future of travel. We look forward to a suite of apps that pave the way towards innovation in the way we drive. Thanks to Honda Silicon Valley Lab, we are happy to provide this exciting opportunity to our developer community. So, travel well and start creating!

Leave a comment

Evernote Japan Announces the Accelerator Program at Their Largest User-Meetup Yet

Japan is Evernote’s second largest market. Back when Evernote was still a small start-up, Japanese users and developers were among the first to promote Evernote. Through word-of-mouth discussions, these early adopters built an active and dedicated developer community. Now there are over 300 Japanese developer apps that integrate with Evernote. The Japanese market has always been a key part of Evernote.

So after announcing Devcup 2013 in March, Phil Libin made plans for a dedicated trip to Tokyo.  This trip also coincided with our April announcement of the new Evernote Accelerator program. We wanted to be sure our Japanese developer community were encouraged and welcomed to join.

japan_announcement

The Evernote Tokyo team organized an event that quickly became the largest Japanese meet-up we’ve had yet: over 300 users, developers, and partners attended! Phil’s keynote about the Evernote Accelerator was a clear highlight. In addition, partners presented, developers joined panel discussion, and various individuals successfully showcased what the Evernote ecosystem is about. We firmly believe that a diverse developer community only leads to creative, high quality Evernote apps.

Evernote Accelerator

Phil Libin illustrated how the Evernote Accelerator program is a clear part of our strategy to meet users’ needs. With over 50 million global users growing at a rate of 10,000 users a day, and with 5 million of these located in Japan, the Accelerator is another way for Evernote to successfully interact with its loyal base of supporters.

japan_panel2

Six finalists from Devcup 2013 will be invited to an all-expenses paid, month-long incubator program at Evernote’s Silicon Valley headquarters. While there, these teams will receive mentorship and a bundle of resources to help build their apps.

The Accelerator is possible in part from our partners, Honda Silicon Valley Lab and Docomo Innovation Ventures. They will help provide the support and resources necessary to nurture these creative ideas. Ultimately, we look forward to seeing a new generation of creative apps that make people’s lives better.

Stay tuned for more developments from Devcup, or sign up today to get in on the action!

The Evernote Team

Leave a comment

Evernote Celebrates Technical Workshops in Colombia and Mexico

Last week we had the opportunity to meet some of the top developers in Latin America at the technical meetups we hosted in Bogota, Colombia, and Monterrey, Mexico.

The first workshop took place on May 22 in Colombia at Wayra Bogota, where more than 40 participants learned about the Evernote API and how to integrate it into new or existing applications. This was our first ever technical workshop in Colombia and it was great to meet the local developer community in this country. We were impressed with the technical talent and the eagerness to learn from the local developer community in Colombia.

The second technical workshop took place in Monterrey, Mexico, where Evernote was part of AngelHack Monterrey, where more than 200 talented developers came together for two days to create a prototype – or hack – of an idea that solves an important problem. Evernote awarded the best integration of our API and, of the 38 projects that participated, five projects integrated their applications to Evernote. The winner was SUMMIT, an application that searches for a job based on your technical capabilities and whose search results are stored directly into Evernote.

Chris Traganos and Mustafa Furniturewala, engineering and design experts from Evernote, traveled from Silicon Valley to train the local developer and startup communities in Bogota and Monterrey. We also invited them to participate in Devcup 2013, an annual competition of software developers and designers that awards the best products associated with the Evernote API.

It was a great experience for both Evernote and the local developer community.  We hope to see a lot of the applications integrate with Evernote and also apply for Devcup 2013. Remember to apply before June 28, 2013.

Fore more information about Devcup 2013, visit this link >>

We’ll keep you posted on our next technical workshop in Latin America.

The Developer Relations Team

Leave a comment

Devcup 2013 – It’s Not Too Late

devcup_614_banner1

Calling all developers and designers,

The deadline for submission to Evernote’s 2013 Devcup is just one month away.  Come June 28th, 2013, all apps must be submitted for review.  For those working hard on what will undoubtedly become a slew of impressive apps, be sure to finish your work by the deadline.  For those of you who have not yet begun working on the Devcup, it’s never too late to get involved.

Devcup 2013 and Why It’s All Sorts of Great

The Devcup is our annual competition for developers and designers who want to create the next great Evernote app.  Last year we had hundreds of entries from all over the world.  You can read the full list of rules here, but we look for apps that show a creative mix of intuitive design and unique functionality.

Devcup 2013 will also provide you with exclusive access to a wide array of our strategic partners: Honda Silicon Valley Lab, Amazon Web Serbvices, and Docomo Innovations.  In addition, Pebble and Leap Motion will be offering prizes for select teams.  Devcup is the perfect opportunity to not only create great apps, but also gain personal access with industry leaders.

Why You Should Get Started Today!

When you’re happy, we’re happy.  That’s why Devcup 2013 will provide a load of opportunity for those involved.  Teams can win recognition in a number of lifestyle categories.  In addition, the top three teams will receive generous cash prizes, allowing them to continue with the successful development of their products.

And of course, there’s the newly announced Evernote Accelerator.  All top category winners are eligible to become one of the first six members of our Accelerator program.  Through the Accelerator, you will gain a month of all-expenses paid space here at the Evernote HQ in Redwood City, CA to continue the development of your app.  We provide you with mentorship, development resources, and access to some of the brightest minds in the Valley.

Anything Goes

We’re looking for anything and everything that will make the Evernote experience that much better. Want to integrate Evernote into your app? Perfect. Think you can get the job done better than us? Prove it. We’re all ears, and can’t wait to see what you can create.

So, if this sounds at all interesting, get started now. Put together a team and begin building an app to make us proud.

Be sure to check out our Devcup Home for all the gritty details. And as always, feel free to reach out to us with any questions.

Now start hacking.

The Developer Relations Team

Leave a comment

Evernote Reminders API Now Available

You may have seen the recent post on the Evernote Blog announcing our newest and most-requested feature: Reminders. In a nutshell, Evernote for Mac, iOS and the web (more platforms coming very soon) can now set reminders on notes and optionally send out alerts on the day or time you specify. Check out the official blog post for a complete overview of Reminders.

For as long as we can remember, Evernote users have been clamoring for a way to integrate Evernote with their favorite calendar applications, task managers, and other apps where dates and times are meaningful. Reminders are the key to these integrations. The new feature opens up a whole new world of cool apps and services that work with Evernote, and you can now build those apps.

In addition to rolling out Reminders to users, we’ve updated our API, as well as all of our SDKs, to take advantage of this new feature. Check out the documentation here.

Tip: if you’re considering submitting an integration to Devcup but aren’t sure what to build, we’re very interested in seeing some integrations using Reminders.

If you have specific questions not addressed in the documentation, feel free to drop us a line and we’ll be happy to help you out.

1 Comment