Simple AngularJS service/directive pair for using login services

Angular Core Dependency: ~1.2.11

Module License: MIT

Added by: Sam Deering





Stars: 6

Watchers: 6

Forks: 0

Module Description

AngularJS service/directive for authenticating with services

Simple AngularJS service/directive pair for authenticating users using the service. Produces a simple button that handles all the calls for you and saves the resulting authenticated user object into your scope.

The saved user object includes the raw endpoint (for making your own manual calls to the provider API), the authenticated user object from the provider (where supported by me() endpoint), and/or any returned error message.


  1. download the files
    1. Bower
      1. add "angular-oauthio-login": "resseguie/angular-oauthio-login#latest" to your bower.json file then run bower install OR run bower install resseguie/angular-oauthio-login
  2. include the files in your app
    1. oauthio-login.min.js
  3. include the module in angular (i.e. in app.js) - resseguie.angular-oauthio-login


At a minimum, this module just depends on AngularJS and's oauth-js, but the directive adds classes that support Bootstrap buttons with Font Awesome icons for each OAuth provider. If the provider name (in lowercase) matches a Font Awesome class name, the icon is added automatically.


Just add the following directive:

    <div drr-oauthio-login
        data-provider-icon="github-alt"  // optional
        data-oauthio-key="<your public key>">

After login, the onLogin callback function will be called. You can extract information from the returned user object after successful authentication such as:

<h1>Logged in as {{}}</h1>

Use the returned endpoint object to make manual OAuth calls to the provider API.


There is a sample application included for testing the directive and showing its usage. You'll just need to run it inside a web server or use something like 'python -m SimpleHTTPServer 8000'.

Module stats last updated: 2015-06-28 11:04:52

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!