<commit_before>![Project Logo](https://lh6.googleusercontent.com/-YmfKZZLZKL0/U-KVPFSbiOI/AAAAAAAAEZA/maoYT8iJCnA/w1089-h513-no/sshot-1.png)

# [Satellizer](https://github.com/sahat/satellizer/)

[![Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](https://paypal.me/sahat) [![Join the chat at https://gitter.im/sahat/satellizer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sahat/satellizer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](http://img.shields.io/travis/sahat/satellizer.svg?style=flat)](https://travis-ci.org/sahat/satellizer)
[![Test Coverage](http://img.shields.io/codeclimate/coverage/github/sahat/satellizer.svg?style=flat)](https://codeclimate.com/github/sahat/satellizer)
[![Version](https://img.shields.io/badge/version-0.14.1-brightgreen.svg)](https://www.npmjs.org/package/satellizer) [![Book session on Codementor](https://cdn.codementor.io/badges/book_session_github.svg)](https://www.codementor.io/sahatyalkabov?utm_source=github&utm_medium=button&utm_term=sahatyalkabov&utm_campaign=github)

**Live Demo:** http://satellizer-satellizer.rhcloud.com

---

**Satellizer** is a simple to use, end-to-end, token-based authentication module
for [AngularJS](http://angularjs.org) with built-in support for Google, Facebook,
LinkedIn, Twitter, Instagram, GitHub, Bitbucket, Yahoo, Twitch, Microsoft (Windows Live) OAuth providers, as well as Email
and Password sign-in. However, you are not limited to the sign-in options above, in fact
you can add any *OAuth 1.0* or *OAuth 2.0* provider by passing provider-specific information
in the app *config* block.

![Screenshot](https://lh4.googleusercontent.com/-0UUIecT-3N4/U-LQJkd75iI/AAAAAAAAEZY/YN3Oe-eUPGc/w1676-h1158-no/satellizer.png)

## Table of Contents

- [Installation](#installation)
 - [Requirements for Mobile Apps](#requirements-for-mobile-apps)
- [Usage](#usage)
- [Configuration](#configuration)
- [Browser Support](#browser-support)
- [Authentication Flow](#authentication-flow)
 - [Login with Email and Password](#-login-with-email-and-password)
 - [Login with OAuth 1.0](#-login-with-oauth-10)
 - [Login with OAuth 2.0](#-login-with-oauth-20)
 - [Logout](#-log-out)
- [Obtaining OAuth Keys](#obtaining-oauth-keys)
- [API Reference](#api-reference)
- [FAQ](#faq)
 - [Can I change `redirectUri` to something other than base URL?](#question-can-i-change-redirecturi-to-something-other-than-base-url)
 - [How can I send a token in a format other than `Authorization: Bearer <token>?`](#question-how-can-i-send-a-token-in-a-format-other-than-authorization-bearer-token)
 - [How can I avoid sending Authorization header on all HTTP requests?](#question-how-can-i-avoid-sending-authorization-header-on-all-http-requests)
 - [Is there a way to dynamically change `localStorage` to `sessionStorage`?](#question-is-there-a-way-to-dynamically-change-localstorage-to-sessionstorage)
 - [I am having a problem with Ionic authentication on iOS 9.](#question-i-am-having-a-problem-with-ionic-authentication-on-ios-9)
- [Community Resources](#community-resources)
- [Credits](#credits)
- [License](#license)

## Installation

The easiest way to get **Satellizer** is by running one of the following commands:

```bash
# Bower
bower install satellizer

# NPM
npm install satellizer
```

Alternatively, you may [**download**](https://github.com/sahat/satellizer/releases) the latest release or use the CDN:

```html
<script src="//cdn.jsdelivr.net/satellizer/0.14.1/satellizer.min.js"></script>
```

If installed via [Bower](http://bower.io/), include one of the following script tags:
```html
<script src="bower_components/satellizer/satellizer.js"></script>
<!-- or -->
<script src="bower_components/satellizer/satellizer.min.js"></script>
```

**Note:** Sattelizer depends on [`window.atob()`](https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/atob) for decoding JSON Web Tokens. If you need to support *IE9* then use Base64 polyfill above.


### Requirements for Mobile Apps

With any Cordova mobile apps or any framework that uses Cordova, such as [Ionic Framework](http://ionicframework.com/), you will need to add [cordova-plugin-inappbrowser](https://cordova.apache.org/docs/en/3.0.0/cordova/inappbrowser/inappbrowser.html) plugin:

```
$ cordova plugin add cordova-plugin-inappbrowser
```

Make sure that **inAppBrowser** is listed in your project:

```
$ cordova plugins
cordova-plugin-console 1.0.2 "Console"
cordova-plugin-device 1.1.1 "Device"<commit_msg>readme updates for typescript / 0. 15 release<commit_after>![Project Logo](https://lh6.googleusercontent.com/-YmfKZZLZKL0/U-KVPFSbiOI/AAAAAAAAEZA/maoYT8iJCnA/w1089-h513-no/sshot-1.png)

# [Satellizer](https://github.com/sahat/satellizer/)

[![Donate](https://img.shields.io/badge/paypal-donate-blue.svg)](https://paypal.me/sahat)
[![Join the chat at https://gitter.im/sahat/satellizer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sahat/satellizer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Build Status](http://img.shields.io/travis/sahat/satellizer.svg?style=flat)](https://travis-ci.org/sahat/satellizer)
[![npm version](https://badge.fury.io/js/satellizer.svg)](https://badge.fury.io/js/satellizer)
[![Book session on Codementor](https://cdn.codementor.io/badges/book_session_github.svg)](https://www.codementor.io/sahatyalkabov?utm_source=github&utm_medium=button&utm_term=sahatyalkabov&utm_campaign=github)

**Live Demo:** http://satellizer-sahat.rhcloud.com

---

**Satellizer** is a simple to use, end-to-end, token-based authentication module
for [AngularJS](http://angularjs.org) with built-in support for Google, Facebook,
LinkedIn, Twitter, Instagram, GitHub, Bitbucket, Yahoo, Twitch, Microsoft (Windows Live) OAuth providers, as well as Email
and Password sign-in. However, you are not limited to the sign-in options above, in fact
you can add any *OAuth 1.0* or *OAuth 2.0* provider by passing provider-specific information
in the app *config* block.

![Screenshot](https://lh4.googleusercontent.com/-0UUIecT-3N4/U-LQJkd75iI/AAAAAAAAEZY/YN3Oe-eUPGc/w1676-h1158-no/satellizer.png)

## Table of Contents

- [Installation](#installation)
 - [Requirements for Mobile Apps](#requirements-for-mobile-apps)
- [Usage](#usage)
- [Configuration](#configuration)
- [Browser Support](#browser-support)
- [Authentication Flow](#authentication-flow)
 - [Login with Email and Password](#-login-with-email-and-password)
 - [Login with OAuth 1.0](#-login-with-oauth-10)
 - [Login with OAuth 2.0](#-login-with-oauth-20)
 - [Logout](#-log-out)
- [Obtaining OAuth Keys](#obtaining-oauth-keys)
- [API Reference](#api-reference)
- [FAQ](#faq)
- [Community Resources](#community-resources)
- [Credits](#credits)
- [License](#license)

## Installation

#### Browser

```html
<script src="angular.js"></script>
<script src="satellizer.js"></script>
```
```html
<!-- Satellizer CDN -->
<script src="https://cdn.jsdelivr.net/satellizer/0.15.0/satellizer.min.js"></script>
```

#### NPM

```
$ npm install satellizer
```

#### Bower

```
$ bower install satellizer
```

### Requirements for Mobile Apps

With any Cordova mobile apps or any framework that uses Cordova, such as [Ionic Framework](http://ionicframework.com/), you will need to add [cordova-plugin-inappbrowser](https://cordova.apache.org/docs/en/3.0.0/cordova/inappbrowser/inappbrowser.html) plugin:

```
$ cordova plugin add cordova-plugin-inappbrowser
```

Make sure that **inAppBrowser** is listed in your project:

```
$ cordova plugins
cordova-plugin-console 1.0.2 "Console"
cordova-plugin-device 1.1.1 "Device"
{'fraction_non_alphanumeric': 0.16496465043205027, 'fraction_numerical': 0.015710919088766692, 'mean_word_length': 5.387123745819398, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 32, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2383380', 'n_tokens_mistral': 2874, 'n_tokens_neox': 2666, 'n_words': 506}