{"id":8183,"date":"2015-11-30T00:41:02","date_gmt":"2015-11-30T00:41:02","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/11\/30\/sahat-satellizer\/"},"modified":"2022-08-30T15:45:34","modified_gmt":"2022-08-30T15:45:34","slug":"sahat-satellizer","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/11\/30\/sahat-satellizer\/","title":{"rendered":"sahat\/satellizer"},"content":{"rendered":"<p><img decoding=\"async\" src=\"http:\/\/lh6.googleusercontent.com\/-YmfKZZLZKL0\/U-KVPFSbiOI\/AAAAAAAAEZA\/maoYT8iJCnA\/w1089-h513-no\/sshot-1.png\" \/><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/badges.gitter.im\/Join%20Chat.svg\" \/> <img decoding=\"async\" src=\"http:\/\/img.shields.io\/travis\/sahat\/satellizer.svg?style=flat\" \/> <img decoding=\"async\" src=\"http:\/\/img.shields.io\/codeclimate\/coverage\/github\/sahat\/satellizer.svg?style=flat\" \/> <img decoding=\"async\" src=\"http:\/\/img.shields.io\/badge\/version-0.10.1-orange.svg?style=flat\" \/><\/p>\n<p><strong>Live Demo:<\/strong> https:\/\/satellizer.herokuapp.com<\/p>\n<p><strong>Satellizer<\/strong> is a simple to use, end-to-end, token-based authentication module for AngularJS with built-in support for Google, Facebook, LinkedIn, Twitter, Yahoo, Windows Live authentication providers, as well as Email and Password sign-in. You are not limited to the sign-in options above, in fact you can add any <em>OAuth 1.0<\/em> or <em>OAuth 2.0<\/em> provider by passing provider-specific information during the configuration step.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/lh4.googleusercontent.com\/-0UUIecT-3N4\/U-LQJkd75iI\/AAAAAAAAEZY\/YN3Oe-eUPGc\/w1676-h1158-no\/satellizer.png\" \/><\/p>\n<h2>Table of Contents<\/h2>\n<h2>Installation<\/h2>\n<p>The easiest way to get <strong>Satellizer<\/strong> is by running one of the following commands:<\/p>\n<pre><code># Bower\nbower install satellizer\n\n# NPM\nnpm install satellizer\n<\/code><\/pre>\n<p><strong>Note:<\/strong> Alternatively, you may download the latest release or use the CDN:<\/p>\n<pre><code>\n\n<\/code><\/pre>\n<p><strong>Note:<\/strong> Sattelizer uses window.btoa and window.atob. If you still need to support <strong>IE9<\/strong>, use the Base64 polyfill above.<\/p>\n<h2>Usage<\/h2>\n<p><strong>Step 1. App Module<\/strong><\/p>\n<pre><code>angular.module('MyApp', ['satellizer'])\n  .config(function($authProvider) {\n\n    $authProvider.facebook({\n      clientId: '624059410963642'\n    });\n\n    $authProvider.google({\n      clientId: '631036554609-v5hm2amv4pvico3asfi97f54sc51ji4o.apps.googleusercontent.com'\n    });\n\n    $authProvider.github({\n      clientId: '0ba2600b1dbdb756688b'\n    });\n\n    $authProvider.linkedin({\n      clientId: '77cw786yignpzj'\n    });\n\n    $authProvider.yahoo({\n      clientId: 'dj0yJmk9dkNGM0RTOHpOM0ZsJmQ9WVdrOVlVTm9hVk0wTkRRbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD0wMA--'\n    });\n\n    $authProvider.live({\n      clientId: '000000004C12E68D'\n    });\n\n    $authProvider.twitter({\n      url: '\/auth\/twitter'\n    });\n\n    $authProvider.oauth2({\n      name: 'foursquare',\n      url: '\/auth\/foursquare',\n      redirectUri: window.location.origin,\n      clientId: 'MTCEJ3NGW2PNNB31WOSBFDSAD4MTHYVAZ1UKIULXZ2CVFC2K',\n      authorizationEndpoint: 'https:\/\/foursquare.com\/oauth2\/authenticate',\n    });\n\n  });\n<\/code><\/pre>\n<p><strong>Step 2. Controller<\/strong><\/p>\n<pre><code>angular.module('MyApp')\n  .controller('LoginCtrl', function($scope, $auth) {\n\n    $scope.authenticate = function(provider) {\n      $auth.authenticate(provider);\n    };\n\n  });\n<\/code><\/pre>\n<p><strong>Step 3. Template<\/strong><\/p>\n<pre><code>Sign in with Facebook\nSign in with Google\nSign in with GitHub\nSign in with LinkedIn\nSign in with Twitter\nSign in with Foursquare\nSign in with Yahoo\nSign in with Windows Live\n<\/code><\/pre>\n<p><strong>Note:<\/strong> For server-side usage please refer to the examples directory.<\/p>\n<h2>Configuration<\/h2>\n<p>Below is a complete listing of all default configuration options.<\/p>\n<pre><code>$authProvider.httpInterceptor = true; \/\/ Add Authorization header to HTTP request\n$authProvider.loginOnSignup = true;\n$authProvider.baseUrl = '\/' \/\/ API Base URL for the paths below.\n$authProvider.loginRedirect = '\/';\n$authProvider.logoutRedirect = '\/';\n$authProvider.signupRedirect = '\/login';\n$authProvider.loginUrl = '\/auth\/login';\n$authProvider.signupUrl = '\/auth\/signup';\n$authProvider.loginRoute = '\/login';\n$authProvider.signupRoute = '\/signup';\n$authProvider.tokenRoot = false; \/\/ set the token parent element if the token is not the JSON root\n$authProvider.tokenName = 'token';\n$authProvider.tokenPrefix = 'satellizer'; \/\/ Local Storage name prefix\n$authProvider.unlinkUrl = '\/auth\/unlink\/';\n$authProvider.unlinkMethod = 'get';\n$authProvider.authHeader = 'Authorization';\n$authProvider.authToken = 'Bearer';\n$authProvider.withCredentials = true;\n$authProvider.platform = 'browser'; \/\/ or 'mobile'\n$authProvider.storage = 'localStorage'; \/\/ or 'sessionStorage'\n\n\/\/ Facebook\n$authProvider.facebook({\n  url: '\/auth\/facebook',\n  authorizationEndpoint: 'https:\/\/www.facebook.com\/v2.3\/dialog\/oauth',\n  redirectUri: window.location.origin || window.location.protocol + '\/\/' + window.location.host + '\/',\n  scope: 'email',\n  scopeDelimiter: ',',\n  requiredUrlParams: ['display', 'scope'],\n  display: 'popup',\n  type: '2.0',\n  popupOptions: { width: 481, height: 269 }\n});\n\n\/\/ Google\n$authProvider.google({\n  url: '\/auth\/google',\n  authorizationEndpoint: 'https:\/\/accounts.google.com\/o\/oauth2\/auth',\n  redirectUri: window.location.origin || window.location.protocol + '\/\/' + window.location.host,\n  scope: ['profile', 'email'];\n  scopePrefix: 'openid';\n  scopeDelimiter: ' ',\n  requiredUrlParams: ['scope'],\n  optionalUrlParams: ['display'],\n  display: 'popup',\n  type: '2.0',\n  popupOptions: { width: 580, height: 400 }\n});\n\n\/\/ LinkedIn\n$authProvider.linkedin({\n  url: '\/auth\/linkedin',\n  authorizationEndpoint: 'https:\/\/www.linkedin.com\/uas\/oauth2\/authorization',\n  redirectUri: window.location.origin || window.location.protocol + '\/\/' + window.location.host,\n  requiredUrlParams: ['state'],\n  scope: [],\n  scopeDelimiter: ' ',\n  state: 'STATE',\n  type: '2.0',\n  popupOptions: { width: 527, height: 582 }\n});\n\n\/\/ Twitter\n$authProvider.twitter({\n  url: '\/auth\/twitter',\n  type: '1.0',\n  popupOptions: { width: 495, height: 645 }\n});\n\n\/\/ GitHub\n$authProvider.github({\n  url: '\/auth\/github',\n  authorizationEndpoint: 'https:\/\/github.com\/login\/oauth\/authorize',\n  redirectUri: window.location.origin || window.location.protocol + '\/\/' + window.location.host,\n  scope: [],\n  scopeDelimiter: ' ',\n  type: '2.0',\n  popupOptions: { width: 1020, height: 618 }\n});\n\n\/\/ Windows Live\n$authProvider.live({\n  url: '\/auth\/live',\n  authorizationEndpoint: 'https:\/\/login.live.com\/oauth20_authorize.srf',\n  redirectUri: window.location.origin || window.location.protocol + '\/\/' + window.location.host,\n  scope: ['wl.basic'],\n  scopeDelimiter: ' ',\n  requiredUrlParams: ['display', 'scope'],\n  display: 'popup',\n  type: '2.0',\n  popupOptions: { width: 500, height: 560 }\n});\n\n\/\/ Yahoo\n$authProvider.yahoo({\n  url: '\/auth\/yahoo',\n  authorizationEndpoint: 'https:\/\/api.login.yahoo.com\/oauth2\/request_auth',\n  redirectUri: window.location.origin || window.location.protocol + '\/\/' + window.location.host,\n  scope: [],\n  scopeDelimiter: ',',\n  type: '2.0',\n  popupOptions: { width: 559, height: 519 }\n});\n\n\/\/ OAuth 2.0\n$authProvider.oauth2({\n  url: null,\n  name: null,\n  scope: null,\n  scopeDelimiter: null,\n  clientId: null,\n  redirectUri: null,\n  popupOptions: null,\n  authorizationEndpoint: null,\n  responseParams: null,\n  requiredUrlParams: null,\n  optionalUrlParams: null,\n  defaultUrlParams: ['response_type', 'client_id', 'redirect_uri'],\n  responseType: 'code'\n});\n\n\/\/ OAuth 1.0\n$authProvider.oauth1({\n  url: null,\n  name: null,\n  popupOptions: null\n});\n<\/code><\/pre>\n<p><strong>Note:<\/strong> If for some reason you are unable to send a token to your server in the following format &#8211; <code>Authorization: Bearer<\/code> , then use <code>$authProvider.authHeader<\/code> method to override this behavior, e.g. set its value to <strong>x-access-token<\/strong> or another custom header that your backend may require.<\/p>\n<h2>Not sending the JWT for specific requests<\/h2>\n<pre><code>\/\/ This request will NOT send the token as it has skipAuthentication\n$http({\n  url: '\/api\/endpoint',\n  skipAuthorization: true\n  method: 'GET'\n});\n<\/code><\/pre>\n<h2>Updating storage<\/h2>\n<p>To toggle from localStorage and sessionStorage run <code>$auth.setStorage('sessionStorage');<\/code> or <code>$auth.setStorage('localStorage');<\/code><\/p>\n<h2>Browser Support<\/h2>\n<pre><code>\n<\/code><\/pre>\n<tr>\n<td align=\"center\"><code>9+<\/code><\/td>\n<td align=\"center\">\u2713<\/td>\n<td align=\"center\">\u2713<\/td>\n<td align=\"center\">\u2713<\/td>\n<td align=\"center\">\u2713<\/td>\n<\/tr>\n<table>\n<tr>\n<td><img decoding=\"async\" src=\"http:\/\/ie.microsoft.com\/testdrive\/ieblog\/2010\/Sep\/16_UserExperiencesEvolvingthebluee_23.png\" \/><\/td>\n<td><img decoding=\"async\" src=\"http:\/\/img3.wikia.nocookie.net\/__cb20120330024137\/logopedia\/images\/d\/d7\/Google_Chrome_logo_2011.svg\" \/><\/td>\n<td><img decoding=\"async\" src=\"http:\/\/media.idownloadblog.com\/wp-content\/uploads\/2014\/06\/Safari-logo-OS-X-Yosemite.png\" \/><\/td>\n<td><img decoding=\"async\" src=\"http:\/\/th09.deviantart.net\/fs71\/200H\/f\/2013\/185\/e\/b\/firefox_2013_vector_icon_by_thegoldenbox-d6bxsye.png\" \/><\/td>\n<td><img decoding=\"async\" src=\"http:\/\/upload.wikimedia.org\/wikipedia\/commons\/d\/d4\/Opera_browser_logo_2013.png\" \/><\/td>\n<\/tr>\n<\/table>\n<p><strong>Note:<\/strong> If you stumble upon a browser version that does not work with <em>Satellizer<\/em> please open an issue so I could update the checkmark with the lowest supported version.<\/p>\n<h2>How It Works<\/h2>\n<p><strong>Satellizer<\/strong> relies on <em>token-based authentication<\/em> using JSON Web Tokens instead of cookies. Each <strong>Wiki<\/strong> link below goes in-depth into how the authentication process works.<\/p>\n<p><strong>Note:<\/strong> To learn more about JSON Web Token (JWT) visit JWT.io.<\/p>\n<h2>Obtaining OAuth Keys<\/h2>\n<p><img decoding=\"async\" src=\"http:\/\/images.google.com\/intl\/en_ALL\/images\/srpr\/logo6w.png\" \/><\/p>\n<ul>\n<li>Visit Google Cloud Console<\/li>\n<li>Click <strong>CREATE PROJECT<\/strong> button<\/li>\n<li>Enter <em>Project Name<\/em>, then click <strong>CREATE<\/strong><\/li>\n<li>Then select <em>APIs &amp; auth<\/em> from the sidebar and click on <em>Credentials<\/em> tab<\/li>\n<li>Click <strong>CREATE NEW CLIENT ID<\/strong> button<\/li>\n<li><strong>Application Type<\/strong>: Web Application<\/li>\n<li><strong>Authorized Javascript origins<\/strong>: <em>http:\/\/localhost:3000<\/em><\/li>\n<li><strong>Authorized redirect URI<\/strong>: <em>http:\/\/localhost:3000<\/em><\/li>\n<\/ul>\n<p><strong>Note:<\/strong> Make sure you have turned on <strong>Contacts API<\/strong> and <strong>Google+ API<\/strong> in the <em>APIs<\/em> tab.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.doit.ba\/img\/facebook.jpg\" \/><\/p>\n<ul>\n<li>Visit Facebook Developers<\/li>\n<li>Click <strong>Apps &gt; Create a New App<\/strong> in the navigation bar<\/li>\n<li>Enter <em>Display Name<\/em>, then choose a category, then click <strong>Create app<\/strong><\/li>\n<li>Click on <em>Settings<\/em> on the sidebar, then click <strong>+ Add Platform<\/strong><\/li>\n<li>Select <strong>Website<\/strong><\/li>\n<li>Enter <em>http:\/\/localhost:3000<\/em> for <em>Site URL<\/em><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/indonesia-royal.com\/wp-content\/uploads\/2014\/06\/twitter-bird-square-logo.jpg\" \/><\/p>\n<ul>\n<li>Sign in at https:\/\/apps.twitter.com<\/li>\n<li>Click on <strong>Create New App<\/strong><\/li>\n<li>Enter your <em>Application Name<\/em>, <em>Description<\/em> and <em>Website<\/em><\/li>\n<li>For <strong>Callback URL<\/strong>: <em>http:\/\/127.0.0.1:3000<\/em><\/li>\n<li>Go to <strong>Settings<\/strong> tab<\/li>\n<li>Under <em>Application Type<\/em> select <strong>Read and Write<\/strong> access<\/li>\n<li>Check the box <strong>Allow this application to be used to Sign in with Twitter<\/strong><\/li>\n<li>Click <strong>Update this Twitter\u2019s applications settings<\/strong><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/blogs.unity3d.com\/wp-content\/uploads\/2013\/12\/New-Microsoft-Logo.png\" \/><\/p>\n<ul>\n<li>Visit Live Connect App Management.<\/li>\n<li>Click on <strong>Create application<\/strong><\/li>\n<li>Enter an <em>Application name<\/em>, then click on <strong>I accept<\/strong> button<\/li>\n<li>Go to <strong>API Settings<\/strong> tab<\/li>\n<li>Enter a <em>Redirect URL<\/em><\/li>\n<li>Click <strong>Save<\/strong><\/li>\n<li>Go to <strong>App Settings<\/strong> tab to get <em>Client ID<\/em> and <em>Client Secret<\/em><\/li>\n<\/ul>\n<blockquote>\n<p><strong>Note:<\/strong> Microsoft does not consider <code>localhost<\/code> or <code>127.0.0.1<\/code> to be a valid URL. As a workaround for local development add <code>127.0.0.1 mylocalwebsite.net<\/code> to <strong>\/etc\/hosts<\/strong> file and specify <code>mylocalwebsite.net<\/code> as your <em>Redirect URL<\/em> on <strong>API Settings<\/strong> tab.<\/p>\n<\/blockquote>\n<h2>API Reference<\/h2>\n<h4><code>$auth.login(user)<\/code><\/h4>\n<p>Sign in via email and password where:<\/p>\n<ul>\n<li><strong>user<\/strong> &#8211; Plain JavaScript object.<\/li>\n<\/ul>\n<h5>Returns<\/h5>\n<ul>\n<li><strong>response<\/strong> &#8211; The <code>$http<\/code> response object from the server.<\/li>\n<\/ul>\n<pre><code>$auth.login({\n  email: $scope.email,\n  password: $scope.password\n});\n<\/code><\/pre>\n<p><strong>Note:<\/strong> This method returns a promise.<\/p>\n<h4><code>$auth.signup(user)<\/code><\/h4>\n<p>Creates a local account with email and password. You can use whatever fields you want as long as you implement them on the server.<\/p>\n<ul>\n<li><strong>user<\/strong> &#8211; Plain JavaScript object.<\/li>\n<\/ul>\n<h4>Returns<\/h4>\n<ul>\n<li><strong>response<\/strong> &#8211; The <code>$http<\/code> response object from the server.<\/li>\n<\/ul>\n<h4>Usage<\/h4>\n<pre><code>$auth.signup({\n  email: $scope.email,\n  password: $scope.password\n}).then(function(response) {\n  console.log(response.data);\n});\n<\/code><\/pre>\n<p><strong>Note:<\/strong> This method returns a promise.<\/p>\n<h4><code>$auth.authenticate(name, [userData])<\/code><\/h4>\n<p>Starts the <em>OAuth 1.0<\/em> or the <em>OAuth 2.0<\/em> authentication flow by opening a popup window:<\/p>\n<ul>\n<li><strong>provider<\/strong> &#8211; One of the built-in provider names or a custom provider name created via <code>$authProvider.oauth1()<\/code> or <code>$authProvider.oauth2()<\/code> methods.<\/li>\n<li><strong>userData<\/strong> &#8211; Optional object for sending additional data to the server along with <code>code<\/code>, <code>clientId<\/code>, <code>redirectUri<\/code> (OAuth 2.0) or <code>oauth_token<\/code>, <code>oauth_verifier<\/code> (OAuth 1.0).<\/li>\n<\/ul>\n<h4>Returns<\/h4>\n<ul>\n<li><strong>response<\/strong> &#8211; The <code>$http<\/code> response object from the server.<\/li>\n<\/ul>\n<h4>Usage<\/h4>\n<pre><code>$auth.authenticate('google').then(function(response) {\n  \/\/ Signed In.\n});\n<\/code><\/pre>\n<p><strong>Note:<\/strong> This method returns a promise.<\/p>\n<h4><code>$auth.logout([redirect])<\/code><\/h4>\n<p>Deletes a JWT from Local Storage.<\/p>\n<ul>\n<li><strong>redirect<\/strong> &#8211; Optional URL string for redirecting after successful logout.<\/li>\n<\/ul>\n<h4>Usage<\/h4>\n<pre><code>$auth.logout();\n<\/code><\/pre>\n<p><strong>Note:<\/strong> This method returns a promise.<\/p>\n<h4><code>$auth.isAuthenticated()<\/code><\/h4>\n<p>Returns <code>true<\/code> if a JWT is present in Local Storage and it is not expired, otherwise returns <code>false<\/code>.<\/p>\n<p><strong>Note:<\/strong> This method expects the exp claim to check for the expiration time.<\/p>\n<h4>Usage<\/h4>\n<pre><code>\/\/ Controller\n$scope.isAuthenticated = function() {\n  return $auth.isAuthenticated();\n};\n<\/code><\/pre>\n<pre><code>\n<\/code><\/pre>\n<ul class=\"nav navbar-nav pull-right\" ng-if=\"!isAuthenticated()\">\n<li><code>Login<\/code><\/li>\n<li><code>Sign up<\/code><\/li>\n<\/ul>\n<pre>\n<\/pre>\n<ul class=\"nav navbar-nav pull-right\" ng-if=\"isAuthenticated()\">\n<li><code>Logout<\/code><\/li>\n<\/ul>\n<pre>\n<\/pre>\n<h4><code><code>$auth.link(provider, [userData])<\/code><\/code><\/h4>\n<p>Links an OAuth provider with the signed-in account. It is practically the same as $auth.authenticate() with the exception that it does not redirect to <code>$authProvider.loginRedirect<\/code> route path.<\/p>\n<ul>\n<li><strong>provider<\/strong> &#8211; One of the built-in provider names or a custom provider name created via <code>$authProvider.oauth1()<\/code> or <code>$authProvider.oauth2()<\/code> methods.<\/li>\n<li><strong>userData<\/strong> &#8211; Optional object for sending additional data to the server along with <code>code<\/code>, <code>clientId<\/code>, <code>redirectUri<\/code> (OAuth 2.0) or <code>oauth_token<\/code>, <code>oauth_verifier<\/code> (OAuth 1.0).<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> Linking accounts business logic is handled entirely on the server.<\/p>\n<h4>Usage<\/h4>\n<pre><code>$auth.link('github');\n<\/code><\/pre>\n<p><strong>Note:<\/strong> This method returns a promise.<\/p>\n<h4><code>$auth.unlink(provider)<\/code><\/h4>\n<p>Unlinks an OAuth provider from the signed-in account. It sends a GET request to <code>\/auth\/unlink\/:provider<\/code>.<\/p>\n<ul>\n<li><strong>provider<\/strong> &#8211; One of the built-in provider names or a custom provider name created via <code>$authProvider.oauth1()<\/code> or <code>$authProvider.oauth2()<\/code> methods.<\/li>\n<\/ul>\n<p><strong>Note:<\/strong> You can override the default <em>unlink path<\/em> above via <code>$authProvider.unlinkUrl<\/code> configuration property.<\/p>\n<p><strong>Note:<\/strong> It uses <code>GET<\/code> method by default, but can be changed via <code>$authProvider.unlinkMethod = 'post'<\/code>. If you are going to use <code>POST<\/code>, <strong>provider<\/strong> obviously should be an object, not a string.<\/p>\n<h4>Usage<\/h4>\n<pre><code>$auth.unlink('github');\n<\/code><\/pre>\n<p><strong>Note:<\/strong> This method returns a promise.<\/p>\n<h4><code>$auth.getToken()<\/code><\/h4>\n<p>Returns a JWT from Local Storage.<\/p>\n<h4>Usage<\/h4>\n<pre><code>$auth.getToken();\n\/\/ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjEyMzQ1Njc4OTAsIm5hbWUiOiJKb2huIERvZSJ9.kRkUHzvZMWXjgB4zkO3d6P1imkdp0ogebLuxnTCiYUU\n<\/code><\/pre>\n<h4><code>$auth.getPayload()<\/code><\/h4>\n<p>Returns a JWT Claims Set, i.e. the middle part of a JSON Web Token.<\/p>\n<h4>Usage<\/h4>\n<pre><code>$auth.getPayload();\n\/\/ { exp: 1414978281, iat: 1413765081, sub: \"544457a3eb129ee822a38fdd\" }\n<\/code><\/pre>\n<h4><code>$auth.setToken(token, [redirect])<\/code><\/h4>\n<p>Saves a JWT or an access token to Local Storage. <em>It uses <code>shared.setToken<\/code> internally.<\/em><\/p>\n<ul>\n<li><strong>token<\/strong> &#8211; An object that takes a JWT (<code>response.data[config.tokenName]<\/code>) or an access token (<code>response.access_token<\/code>).<\/li>\n<li><strong>redirect<\/strong> &#8211; An optional boolean value that controls whether or not to redirect to <code>loginRedirect<\/code> route after saving a token. Defaults to <code>false<\/code>.<\/li>\n<\/ul>\n<h4><code>$auth.removeToken()<\/code><\/h4>\n<p>Removes a JWT from Local Storage.<\/p>\n<h2>TODO<\/h2>\n<ul>\n<li>[ ] C# (ASP.NET vNext) implementation<\/li>\n<li>[ ] Go implementation<\/li>\n<li>[x] Java (Dropwizard) implementation<\/li>\n<li>[x] Node.js (Express) implementation<\/li>\n<li>[x] PHP (Laravel) implementation<\/li>\n<li>[x] Python (Flask) implementation<\/li>\n<li>[x] Ruby (Ruby on Rails) implementation<\/li>\n<\/ul>\n<h2>Contributing<\/h2>\n<p>Found a typo or a bug? Send a pull request. I would especially appreciate pull requests for server-side examples since I do not have much experience with any of the languages on the <em>TODO<\/em> list.<\/p>\n<h2>Credits<\/h2>\n<p>A big thanks goes to Alice Chen for all your hard work on the Dropwizard implementation and Jes\u00fas Rodr\u00edguez for being so proactive and actively reporting bugs.<\/p>\n<p>Additionally, I would like to thank all other contributors who have submitted issues and\/or pull requests!<\/p>\n<p>Satellizer was inspired by ng-token-auth and torii and angular-oauth.<\/p>\n<h2>License<\/h2>\n<p>The MIT License (MIT)<\/p>\n<p>Copyright \u00a9 2015 Sahat Yalkabov<\/p>\n<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and\/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<\/p>\n<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<\/p>\n<p>THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Live Demo: https:\/\/satellizer.herokuapp.com Satellizer is a simple to use, end-to-end, token-based authentication module for AngularJS with built-in support for Google, Facebook, LinkedIn, Twitter, Yahoo, Windows Live authentication providers, as well as Email and Password sign-in. You are not limited to the sign-in options above, in fact you can add any OAuth 1.0 or OAuth 2.0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,1],"tags":[],"class_list":["post-8183","post","type-post","status-publish","format-standard","hentry","category-laravel","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=8183"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8183\/revisions"}],"predecessor-version":[{"id":8554,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/8183\/revisions\/8554"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=8183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=8183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=8183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}