diff --git a/dist/ng-cordova-oauth.js b/dist/ng-cordova-oauth.js index ff20b88..246f8dd 100644 --- a/dist/ng-cordova-oauth.js +++ b/dist/ng-cordova-oauth.js @@ -24,7 +24,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://api.500px.com/v1/api/js-sdk/authorize?sdk_key=' + sdkKey + '&callback=' + redirect_uri, '_blank', 'toolbar=no,zoom=no,location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://api.500px.com/v1/api/js-sdk/authorize?sdk_key=' + sdkKey + '&callback=' + redirect_uri, '_blank', 'toolbar=no,zoom=no,location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var accessToken = (event.url).split("#token:")[1].split(',')[0]; @@ -70,7 +70,7 @@ var deferred = $q.defer(); if(window.cordova) { if($cordovaOauthUtility.isInAppBrowserInstalled()) { - var browserRef = window.cordova.InAppBrowser.open(adfsServer + '/adfs/oauth2/authorize?response_type=code&client_id=' + clientId +'&redirect_uri=http://localhost/callback&resource=' + relyingPartyId, '_blank', 'location=no'); + var browserRef = window.cordova.InAppBrowser.open(adfsServer + '/adfs/oauth2/authorize?response_type=code&client_id=' + clientId +'&redirect_uri=http://localhost/callback&resource=' + relyingPartyId, '_blank', 'location=no,allowinlinemediaplayback=YES'); browserRef.addEventListener("loadstart", function(event) { if((event.url).indexOf('http://localhost/callback') === 0) { @@ -128,7 +128,7 @@ if(window.cordova) { if($cordovaOauthUtility.isInAppBrowserInstalled()) { - var browserRef = window.cordova.InAppBrowser.open('https://login.microsoftonline.com/' + tenantId + '/oauth2/authorize?response_type=code&client_id=' + clientId + '&redirect_uri=http://localhost/callback', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://login.microsoftonline.com/' + tenantId + '/oauth2/authorize?response_type=code&client_id=' + clientId + '&redirect_uri=http://localhost/callback', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener("loadstart", function(event) { if((event.url).indexOf('http://localhost/callback') === 0) { var requestToken = (event.url).split("code=")[1]; @@ -197,7 +197,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://app.box.com/api/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&state=' + appState + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://app.box.com/api/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&state=' + appState + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -260,7 +260,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open("https://cloud.digitalocean.com/v1/oauth/authorize?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=read%20write", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + var browserRef = window.cordova.InAppBrowser.open("https://cloud.digitalocean.com/v1/oauth/authorize?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=code&scope=read%20write", "_blank", "location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES"); browserRef.addEventListener("loadstart", function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -334,7 +334,7 @@ var scope = appScope.join(",").replace(/,/g, '+'); //dribble scopes are passed with + var browserRef = window.cordova.InAppBrowser.open(OAUTH_URL + '?client_id=' + clientId + '&redirect_uri=' + redirect_uri + - '&scope=' + scope + '&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + '&scope=' + scope + '&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function (event) { if ((event.url).indexOf(redirect_uri) === 0) { var callBackCode = (event.url).split("code=")[1]; @@ -400,7 +400,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open("https://www.dropbox.com/1/oauth2/authorize?client_id=" + appKey + "&redirect_uri=" + redirect_uri + "&response_type=token", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + var browserRef = window.cordova.InAppBrowser.open("https://www.dropbox.com/1/oauth2/authorize?client_id=" + appKey + "&redirect_uri=" + redirect_uri + "&response_type=token", "_blank", "location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES"); browserRef.addEventListener("loadstart", function(event) { if ((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -460,7 +460,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://api.envato.com/authorization?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://api.envato.com/authorization?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -528,7 +528,7 @@ if(options !== undefined && options.hasOwnProperty("auth_type")) { flowUrl += "&auth_type=" + options.auth_type; } - var browserRef = window.cordova.InAppBrowser.open(flowUrl, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open(flowUrl, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -592,7 +592,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open("https://ident.familysearch.org/cis-web/oauth2/v3/authorization?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=code&state=" + state, "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + var browserRef = window.cordova.InAppBrowser.open("https://ident.familysearch.org/cis-web/oauth2/v3/authorization?client_id=" + clientId + "&redirect_uri=" + redirect_uri + "&response_type=code&state=" + state, "_blank", "location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES"); browserRef.addEventListener("loadstart", function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -653,7 +653,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://foursquare.com/oauth2/authenticate?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://foursquare.com/oauth2/authenticate?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function (event) { if ((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -722,7 +722,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://github.com/login/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://github.com/login/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -784,7 +784,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://accounts.google.com/o/oauth2/auth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(" ") + '&approval_prompt=force&response_type=token id_token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://accounts.google.com/o/oauth2/auth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(" ") + '&approval_prompt=force&response_type=token id_token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener("loadstart", function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -844,7 +844,7 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://api.imgur.com/oauth2/authorize?client_id=' + clientId + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open('https://api.imgur.com/oauth2/authorize?client_id=' + clientId + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -921,7 +921,12 @@ scope = '&scope' + appScope.join('+'); } - var browserRef = window.cordova.InAppBrowser.open('https://api.instagram.com/oauth/authorize/?client_id=' + clientId + '&redirect_uri=' + redirect_uri + scope + '&response_type='+response_type, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open( + 'https://api.instagram.com/oauth/authorize/?client_id=' + clientId + '&redirect_uri=' + redirect_uri + scope + '&response_type='+response_type, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -982,7 +987,12 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://jawbone.com/auth/oauth2/auth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=' + appScope.join(" "), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://jawbone.com/auth/oauth2/auth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=code&scope=' + appScope.join(" "), + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { @@ -1197,7 +1207,12 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(" ") + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open( + 'https://www.linkedin.com/uas/oauth2/authorization?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(" ") + '&response_type=code&state=' + state, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { try { @@ -1285,7 +1300,12 @@ } var tokenSecret = parameterMap.oauth_token_secret; - var browserRef = window.cordova.InAppBrowser.open(baseUrl + '/oauth/authorize?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + baseUrl + '/oauth/authorize?oauth_token=' + parameterMap.oauth_token, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); browserRef.addEventListener('loadstart', function(event) { if ((event.url).indexOf("http://localhost/callback") === 0) { @@ -1380,7 +1400,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://secure.meetup.com/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://secure.meetup.com/oauth2/authorize/?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -1440,7 +1466,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open("http://auth.mercadolibre.com.ar/authorization?client_id=" + appId + "&redirect_uri=" + redirect_uri + "&response_type=token", "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + + var browserRef = window.cordova.InAppBrowser.open( + "http://auth.mercadolibre.com.ar/authorization?client_id=" + appId + "&redirect_uri=" + redirect_uri + "&response_type=token", + "_blank", + "location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES" + ); + browserRef.addEventListener("loadstart", function(event) { if ((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -1499,7 +1531,7 @@ var clientSecret = (options.clientSecret)? options.clientSecret: null; var appScope = (options.appScope)? options.appScope: null; var state = (options.state)? options.state: Math.random().toString(36).substr(2, 5); - var inappbrowserOptions = (options.inappbrowserOptions)? options.inappbrowserOptions: 'location=no,clearsessioncache=yes,clearcache=yes'; + var inappbrowserOptions = (options.inappbrowserOptions)? options.inappbrowserOptions: 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES'; if(window.cordova) { if($cordovaOauthUtility.isInAppBrowserInstalled()) { @@ -1598,7 +1630,13 @@ var deferred = $q.defer(); if (window.cordova) { if ($cordovaOauthUtility.isInAppBrowserInstalled()) { - var browserRef = window.cordova.InAppBrowser.open('http://www.odnoklassniki.ru/oauth/authorize?client_id=' + clientId + '&scope=' + appScope.join(",") + '&response_type=token&redirect_uri=http://localhost/callback' + '&layout=m', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'http://www.odnoklassniki.ru/oauth/authorize?client_id=' + clientId + '&scope=' + appScope.join(",") + '&response_type=token&redirect_uri=http://localhost/callback' + '&layout=m', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function (event) { if ((event.url).indexOf("http://localhost/callback") === 0) { var callbackResponse = (event.url).split("#")[1]; @@ -1673,7 +1711,13 @@ }) .success(function(data) { var code = data.split("code=")[1]; - var browserRef = window.cordova.InAppBrowser.open('https://getpocket.com/auth/authorize?request_token=' + code + '&redirect_uri=' + redirect_url, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://getpocket.com/auth/authorize?request_token=' + code + '&redirect_uri=' + redirect_url, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_url) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -1749,7 +1793,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://rally1.rallydev.com/login/oauth2/auth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://rally1.rallydev.com/login/oauth2/auth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope + '&response_type=code', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf("http://localhost/callback") === 0) { var requestToken = (event.url).split("code=")[1]; @@ -1813,7 +1863,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://ssl.reddit.com/api/v1/authorize' + (compact ? '.compact' : '') + '?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&duration=permanent&state=ngcordovaoauth&scope=' + appScope.join(",") + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://ssl.reddit.com/api/v1/authorize' + (compact ? '.compact' : '') + '?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&duration=permanent&state=ngcordovaoauth&scope=' + appScope.join(",") + '&response_type=code', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -1882,7 +1938,13 @@ var deferred = $q.defer(); if(window.cordova) { if($cordovaOauthUtility.isInAppBrowserInstalled()) { - var browserRef = window.cordova.InAppBrowser.open(getAuthorizeUrl(loginUrl, clientId, redirectUri), "_blank", "location=no,clearsessioncache=yes,clearcache=yes"); + + var browserRef = window.cordova.InAppBrowser.open( + getAuthorizeUrl(loginUrl, clientId, redirectUri), + "_blank", + "location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES" + ); + browserRef.addEventListener("loadstart", function(event) { if(startWith(event.url, redirectUri)) { var oauthResponse = {}; @@ -1953,7 +2015,12 @@ } } - var browserRef = window.cordova.InAppBrowser.open('https://slack.com/oauth/authorize' + '?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&state=ngcordovaoauth&scope=' + appScope.join(","), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open( + 'https://slack.com/oauth/authorize' + '?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&state=ngcordovaoauth&scope=' + appScope.join(","), + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -2027,7 +2094,13 @@ show_dialog = "&show_dialog=" + options.show_dialog; } } - var browserRef = window.cordova.InAppBrowser.open('https://accounts.spotify.com/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=' + response_type + state + '&scope=' + appScope.join(" ") + show_dialog, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://accounts.spotify.com/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=' + response_type + state + '&scope=' + appScope.join(" ") + show_dialog, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -2093,7 +2166,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://www.strava.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(",") + '&response_type=code&approval_prompt=force', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://www.strava.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope.join(",") + '&response_type=code&approval_prompt=force', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -2157,7 +2236,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://connect.stripe.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope + '&response_type=code', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://connect.stripe.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&scope=' + appScope + '&response_type=code', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf("http://localhost/callback") === 0) { var requestToken = (event.url).split("code=")[1]; @@ -2221,7 +2306,12 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://trakt.tv/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=code&state=' + state, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open( + 'https://trakt.tv/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=code&state=' + state, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { try { @@ -2316,8 +2406,14 @@ if(parameterMap.hasOwnProperty("oauth_token") === false) { deferred.reject("Oauth request token was not received"); } - var browserRef = window.cordova.InAppBrowser.open('https://api.twitter.com/oauth/authenticate?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { + + var browserRef = window.cordova.InAppBrowser.open( + 'https://api.twitter.com/oauth/authenticate?oauth_token=' + parameterMap.oauth_token, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var callbackResponse = (event.url).split("?")[1]; var responseParameters = (callbackResponse).split("&"); @@ -2415,7 +2511,12 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://login.uber.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token&scope=' + appScope.join(" "), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open( + 'https://login.uber.com/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token&scope=' + appScope.join(" "), + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -2478,7 +2579,13 @@ redirect_url = options.redirect_url; } } - var browserRef = window.cordova.InAppBrowser.open('https://untappd.com/oauth/authenticate/?client_id=' + clientId + '&redirect_url=' + redirect_url + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://untappd.com/oauth/authenticate/?client_id=' + clientId + '&redirect_url=' + redirect_url + '&response_type=token', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes' + ); + browserRef.addEventListener('loadstart', function (event) { if ((event.url).indexOf(redirect_url) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -2545,7 +2652,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://api.venmo.com/v1/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token&scope=' + appScope.join(" "), '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://api.venmo.com/v1/oauth/authorize?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token&scope=' + appScope.join(" "), + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); @@ -2604,7 +2717,13 @@ var deferred = $q.defer(); if(window.cordova) { if($cordovaOauthUtility.isInAppBrowserInstalled()) { - var browserRef = window.cordova.InAppBrowser.open('https://oauth.vk.com/authorize?client_id=' + clientId + '&redirect_uri=http://oauth.vk.com/blank.html&response_type=token&scope=' + appScope.join(",") + '&display=touch&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://oauth.vk.com/authorize?client_id=' + clientId + '&redirect_uri=http://oauth.vk.com/blank.html&response_type=token&scope=' + appScope.join(",") + '&display=touch&response_type=token', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { var tmp = (event.url).split("#"); if (tmp[0] == 'https://oauth.vk.com/blank.html' || tmp[0] == 'http://oauth.vk.com/blank.html') { @@ -2682,7 +2801,12 @@ } } - var browserRef = window.cordova.InAppBrowser.open(flowUrl, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + var browserRef = window.cordova.InAppBrowser.open( + flowUrl, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var requestToken = (event.url).split("code=")[1]; @@ -2745,7 +2869,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://login.live.com/oauth20_authorize.srf?client_id=' + clientId + "&scope=" + appScope.join(",") + '&response_type=token&display=touch' + '&redirect_uri=' + redirect_uri, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://login.live.com/oauth20_authorize.srf?client_id=' + clientId + "&scope=" + appScope.join(",") + '&response_type=token&display=touch' + '&redirect_uri=' + redirect_uri, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function (event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit", function (event) { }); @@ -2834,7 +2964,12 @@ oauthObject.oauth_signature = signatureObj.signature; var authorizeParameters = $cordovaOauthUtility.generateUrlParameters(oauthObject); - var browserRef = window.cordova.InAppBrowser.open(authorizeUrlBase + '?' + authorizeParameters, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + authorizeUrlBase + '?' + authorizeParameters, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); // STEP 3: User Data Access token browserRef.addEventListener('loadstart', function(event) { @@ -2953,8 +3088,14 @@ deferred.reject('Oauth request token was not received'); } var oauthTokenSecret = parameterMap.oauth_token_secret; - var browserRef = window.cordova.InAppBrowser.open('https://api.xing.com/v1/authorize?oauth_token=' + parameterMap.oauth_token, '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); - browserRef.addEventListener('loadstart', function(event) { + + var browserRef = window.cordova.InAppBrowser.open( + 'https://api.xing.com/v1/authorize?oauth_token=' + parameterMap.oauth_token, + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { var callbackResponse = (event.url).split('?')[1]; var responseParameters = (callbackResponse).split('&'); @@ -3060,7 +3201,7 @@ var browserRef = window.cordova.InAppBrowser.open( providerUrl, '_blank', - 'location=no,clearsessioncache=yes,clearcache=yes' + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' ); browserRef.addEventListener("loadstart", function(event) { @@ -3129,7 +3270,13 @@ redirect_uri = options.redirect_uri; } } - var browserRef = window.cordova.InAppBrowser.open('https://www.yammer.com/dialog/oauth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', '_blank', 'location=no,clearsessioncache=yes,clearcache=yes'); + + var browserRef = window.cordova.InAppBrowser.open( + 'https://www.yammer.com/dialog/oauth?client_id=' + clientId + '&redirect_uri=' + redirect_uri + '&response_type=token', + '_blank', + 'location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES' + ); + browserRef.addEventListener('loadstart', function(event) { if((event.url).indexOf(redirect_uri) === 0) { browserRef.removeEventListener("exit",function(event){}); diff --git a/dist/ng-cordova-oauth.min.js b/dist/ng-cordova-oauth.min.js index e86be16..9d67c3b 100644 --- a/dist/ng-cordova-oauth.min.js +++ b/dist/ng-cordova-oauth.min.js @@ -1,4 +1,4 @@ -// ng-cordova-oauth - v0.2.10 (2016-07-20) +// ng-cordova-oauth - v0.2.10 (2016-08-08) // http://www.nraboy.com -!function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://api.500px.com/v1/api/js-sdk/authorize?sdk_key="+b+"&callback="+f,"_blank","toolbar=no,zoom=no,location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){var b=a.url.split("#token:")[1].split(",")[0];e.resolve({error:!1,success:!0,access_token:b,callback:f})}else e.reject({success:!1,callback:f,error:!0,access_token:null})}),g.addEventListener("exit",function(a){e.reject("The sign in flow was canceled")})}else e.reject("Could not find InAppBrowser plugin");else e.reject("Cannot authenticate via a web browser");return e.promise}return{signin:d}}angular.module("oauth.500px",["oauth.utils"]).factory("$ngCordova500px",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h=window.cordova.InAppBrowser.open(e+"/adfs/oauth2/authorize?response_type=code&client_id="+d+"&redirect_uri=http://localhost/callback&resource="+f,"_blank","location=no");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:e+"/adfs/oauth2/token",data:"client_id="+d+"&code="+c+"&redirect_uri=http://localhost/callback&grant_type=authorization_code"}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){h.close()},10)})}}),h.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.adfs",["oauth.utils"]).factory("$ngCordovaAdfs",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h=window.cordova.InAppBrowser.open("https://login.microsoftonline.com/"+e+"/oauth2/authorize?response_type=code&client_id="+d+"&redirect_uri=http://localhost/callback","_blank","location=no,clearsessioncache=yes,clearcache=yes");h.addEventListener("loadstart",function(a){if(0===a.url.indexOf("http://localhost/callback")){var c=a.url.split("code=")[1];console.log(c),b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://login.microsoftonline.com/"+e+"/oauth2/token",data:"client_id="+d+"&code="+c+"&redirect_uri=http://localhost/callback&grant_type=authorization_code&resource="+f}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){h.close()},10)})}}),h.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.azuread",["oauth.utils"]).factory("$ngCordovaAzureAD",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://app.box.com/api/oauth2/authorize/?client_id="+d+"&redirect_uri="+i+"&state="+f+"&response_type=code","_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://app.box.com/api/oauth2/token",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+i+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.box",["oauth.utils"]).factory("$ngCordovaBox",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var h="http://localhost/callback";void 0!==f&&f.hasOwnProperty("redirect_uri")&&(h=f.redirect_uri);var i=window.cordova.InAppBrowser.open("https://cloud.digitalocean.com/v1/oauth/authorize?client_id="+d+"&redirect_uri="+h+"&response_type=code&scope=read%20write","_blank","location=no,clearsessioncache=yes,clearcache=yes");i.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://cloud.digitalocean.com/v1/oauth/token",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+h+"&grant_type=authorization_code&code="+c}).success(function(a){g.resolve(a)}).error(function(a,b){g.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){i.close()},10)})}}),i.addEventListener("exit",function(a){g.reject("The sign in flow was canceled")})}else g.reject("Could not find InAppBrowser plugin");else g.reject("Cannot authenticate via a web browser");return g.promise}return{signin:d}}angular.module("oauth.digitalOcean",["oauth.utils"]).factory("$ngCordovaDigitalOcean",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback",k="https://dribbble.com/oauth/authorize",l="https://dribbble.com/oauth/token";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(j=g.redirect_uri),void 0===h&&(h=c.createNonce(5));var m=f.join(",").replace(/,/g,"+"),n=window.cordova.InAppBrowser.open(k+"?client_id="+d+"&redirect_uri="+j+"&scope="+m+"&state="+h,"_blank","location=no,clearsessioncache=yes,clearcache=yes");n.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j)){var c=a.url.split("code=")[1],f=c.split("&")[0];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:l,data:"client_id="+d+"&redirect_uri="+j+"&client_secret="+e+"&code="+f}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating ")})["finally"](function(){setTimeout(function(){n.close()},10)})}}),n.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.dribble",["oauth.utils"]).factory("$ngCordovaDribble",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(b,d){var e=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var f="http://localhost/callback";void 0!==d&&d.hasOwnProperty("redirect_uri")&&(f=d.redirect_uri);var g=window.cordova.InAppBrowser.open("https://www.dropbox.com/1/oauth2/authorize?client_id="+b+"&redirect_uri="+f+"&response_type=token","_blank","location=no,clearsessioncache=yes,clearcache=yes");g.addEventListener("loadstart",function(a){if(0===a.url.indexOf(f)){g.removeEventListener("exit",function(a){}),g.close();for(var b=a.url.split("#")[1],c=b.split("&"),d=[],h=0;h0&&(j="&scope"+d.join("+"));var k=window.cordova.InAppBrowser.open("https://api.instagram.com/oauth/authorize/?client_id="+b+"&redirect_uri="+h+j+"&response_type="+i,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){k.removeEventListener("exit",function(a){}),k.close();var b=a.url.split(g[i])[1],d=c.parseResponseParameters(b);d.access_token?f.resolve({access_token:d.access_token}):void 0!==d.code&&null!==d.code?f.resolve({code:d.code}):f.reject("Problem authenticating")}}),k.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.instagram",["oauth.utils"]).factory("$ngCordovaInstagram",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://jawbone.com/auth/oauth2/auth?client_id="+d+"&redirect_uri="+i+"&response_type=code&scope="+f.join(" "),"_blank","location=no,clearsessioncache=yes,clearcache=yes");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://jawbone.com/auth/oauth2/token",data:"client_id="+d+"&client_secret="+e+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.jawbone",["oauth.utils"]).factory("$ngCordovaJawbone",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R){return{azureAD:d.signin,adfs:e.signin,dropbox:f.signin,digitalOcean:g.signin,google:h.signin,github:i.signin,facebook:j.signin,linkedin:k.signin,instagram:l.signin,box:m.signin,reddit:n.signin,slack:o.signin,twitter:p.signin,meetup:q.signin,salesforce:r.signin,strava:s.signin,withings:t.signin,foursquare:u.signin,magento:v.signin,vkontakte:w.signin,odnoklassniki:x.signin,imgur:y.signin,spotify:z.signin,uber:A.signin,windowsLive:B.signin,yammer:C.signin,venmo:D.signin,stripe:E.signin,rally:F.signin,familySearch:G.signin,envato:H.signin,weibo:I.signin,jawbone:J.signin,untappd:K.signin,dribble:L.signin,pocket:M.signin,mercadolibre:N.signin,xing:O.signin,netatmo:P.signin,trakttv:Q.signin,yahoo:R.signin}}angular.module("oauth.providers",["oauth.utils","oauth.500px","oauth.azuread","oauth.adfs","oauth.dropbox","oauth.digitalOcean","oauth.google","oauth.github","oauth.facebook","oauth.linkedin","oauth.instagram","oauth.box","oauth.reddit","oauth.slack","oauth.twitter","oauth.meetup","oauth.salesforce","oauth.strava","oauth.withings","oauth.foursquare","oauth.magento","oauth.vkontakte","oauth.odnoklassniki","oauth.imgur","oauth.spotify","oauth.uber","oauth.windowslive","oauth.yammer","oauth.venmo","oauth.stripe","oauth.rally","oauth.familySearch","oauth.envato","oauth.weibo","oauth.jawbone","oauth.untappd","oauth.dribble","oauth.pocket","oauth.mercadolibre","oauth.xing","oauth.netatmo","oauth.trakttv","oauth.yahoo"]).factory("$cordovaOauth",a),a.$inject=["$q","$http","$cordovaOauthUtility","$ngCordovaAzureAD","$ngCordovaAdfs","$ngCordovaDropbox","$ngCordovaDigitalOcean","$ngCordovaGoogle","$ngCordovaGithub","$ngCordovaFacebook","$ngCordovaLinkedin","$ngCordovaInstagram","$ngCordovaBox","$ngCordovaReddit","$ngCordovaSlack","$ngCordovaTwitter","$ngCordovaMeetup","$ngCordovaSalesforce","$ngCordovaStrava","$ngCordovaWithings","$ngCordovaFoursquare","$ngCordovaMagento","$ngCordovaVkontakte","$ngCordovaOdnoklassniki","$ngCordovaImgur","$ngCordovaSpotify","$ngCordovaUber","$ngCordovaWindowslive","$ngCordovaYammer","$ngCordovaVenmo","$ngCordovaStripe","$ngCordovaRally","$ngCordovaFamilySearch","$ngCordovaEnvato","$ngCordovaWeibo","$ngCordovaJawbone","$ngCordovaUntappd","$ngCordovaDribble","$ngCordovaPocket","$ngCordovaMercadolibre","$ngCordovaXing","$ngCordovaNetatmo","$ngCordovaTraktTv","$ngCordovaYahoo"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback";void 0!==h&&h.hasOwnProperty("redirect_uri")&&(j=h.redirect_uri);var k=window.cordova.InAppBrowser.open("https://www.linkedin.com/uas/oauth2/authorization?client_id="+d+"&redirect_uri="+j+"&scope="+f.join(" ")+"&response_type=code&state="+g,"_blank","location=no,clearsessioncache=yes,clearcache=yes");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j))try{var c=a.url.split("code=")[1].split("&")[0];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://www.linkedin.com/uas/oauth2/accessToken",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+j+"&grant_type=authorization_code&code="+c}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){k.close()},10)})}catch(f){setTimeout(function(){k.close()},10)}}),k.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.linkedin",["oauth.utils"]).factory("$ngCordovaLinkedin",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled())if("undefined"!=typeof jsSHA){var h={oauth_callback:"http://localhost/callback",oauth_consumer_key:e,oauth_nonce:c.createNonce(5),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:Math.round((new Date).getTime()/1e3),oauth_version:"1.0"},i=c.createSignature("POST",d+"/oauth/initiate",h,{oauth_callback:"http://localhost/callback"},f);b.defaults.headers.post.Authorization=i.authorization_header,b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:d+"/oauth/initiate",data:"oauth_callback=http://localhost/callback"}).success(function(a){for(var e=a.split("&"),i={},j=0;j0&&(j="&scope"+d.join("+"));var k=window.cordova.InAppBrowser.open("https://api.instagram.com/oauth/authorize/?client_id="+b+"&redirect_uri="+h+j+"&response_type="+i,"_blank","location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(h)){k.removeEventListener("exit",function(a){}),k.close();var b=a.url.split(g[i])[1],d=c.parseResponseParameters(b);d.access_token?f.resolve({access_token:d.access_token}):void 0!==d.code&&null!==d.code?f.resolve({code:d.code}):f.reject("Problem authenticating")}}),k.addEventListener("exit",function(a){f.reject("The sign in flow was canceled")})}else f.reject("Could not find InAppBrowser plugin");else f.reject("Cannot authenticate via a web browser");return f.promise}return{signin:d}}angular.module("oauth.instagram",["oauth.utils"]).factory("$ngCordovaInstagram",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g){var h=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var i="http://localhost/callback";void 0!==g&&g.hasOwnProperty("redirect_uri")&&(i=g.redirect_uri);var j=window.cordova.InAppBrowser.open("https://jawbone.com/auth/oauth2/auth?client_id="+d+"&redirect_uri="+i+"&response_type=code&scope="+f.join(" "),"_blank","location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES");j.addEventListener("loadstart",function(a){if(0===a.url.indexOf(i)){var c=a.url.split("code=")[1];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://jawbone.com/auth/oauth2/token",data:"client_id="+d+"&client_secret="+e+"&grant_type=authorization_code&code="+c}).success(function(a){h.resolve(a)}).error(function(a,b){h.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){j.close()},10)})}}),j.addEventListener("exit",function(a){h.reject("The sign in flow was canceled")})}else h.reject("Could not find InAppBrowser plugin");else h.reject("Cannot authenticate via a web browser");return h.promise}return{signin:d}}angular.module("oauth.jawbone",["oauth.utils"]).factory("$ngCordovaJawbone",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R){return{azureAD:d.signin,adfs:e.signin,dropbox:f.signin,digitalOcean:g.signin,google:h.signin,github:i.signin,facebook:j.signin,linkedin:k.signin,instagram:l.signin,box:m.signin,reddit:n.signin,slack:o.signin,twitter:p.signin,meetup:q.signin,salesforce:r.signin,strava:s.signin,withings:t.signin,foursquare:u.signin,magento:v.signin,vkontakte:w.signin,odnoklassniki:x.signin,imgur:y.signin,spotify:z.signin,uber:A.signin,windowsLive:B.signin,yammer:C.signin,venmo:D.signin,stripe:E.signin,rally:F.signin,familySearch:G.signin,envato:H.signin,weibo:I.signin,jawbone:J.signin,untappd:K.signin,dribble:L.signin,pocket:M.signin,mercadolibre:N.signin,xing:O.signin,netatmo:P.signin,trakttv:Q.signin,yahoo:R.signin}}angular.module("oauth.providers",["oauth.utils","oauth.500px","oauth.azuread","oauth.adfs","oauth.dropbox","oauth.digitalOcean","oauth.google","oauth.github","oauth.facebook","oauth.linkedin","oauth.instagram","oauth.box","oauth.reddit","oauth.slack","oauth.twitter","oauth.meetup","oauth.salesforce","oauth.strava","oauth.withings","oauth.foursquare","oauth.magento","oauth.vkontakte","oauth.odnoklassniki","oauth.imgur","oauth.spotify","oauth.uber","oauth.windowslive","oauth.yammer","oauth.venmo","oauth.stripe","oauth.rally","oauth.familySearch","oauth.envato","oauth.weibo","oauth.jawbone","oauth.untappd","oauth.dribble","oauth.pocket","oauth.mercadolibre","oauth.xing","oauth.netatmo","oauth.trakttv","oauth.yahoo"]).factory("$cordovaOauth",a),a.$inject=["$q","$http","$cordovaOauthUtility","$ngCordovaAzureAD","$ngCordovaAdfs","$ngCordovaDropbox","$ngCordovaDigitalOcean","$ngCordovaGoogle","$ngCordovaGithub","$ngCordovaFacebook","$ngCordovaLinkedin","$ngCordovaInstagram","$ngCordovaBox","$ngCordovaReddit","$ngCordovaSlack","$ngCordovaTwitter","$ngCordovaMeetup","$ngCordovaSalesforce","$ngCordovaStrava","$ngCordovaWithings","$ngCordovaFoursquare","$ngCordovaMagento","$ngCordovaVkontakte","$ngCordovaOdnoklassniki","$ngCordovaImgur","$ngCordovaSpotify","$ngCordovaUber","$ngCordovaWindowslive","$ngCordovaYammer","$ngCordovaVenmo","$ngCordovaStripe","$ngCordovaRally","$ngCordovaFamilySearch","$ngCordovaEnvato","$ngCordovaWeibo","$ngCordovaJawbone","$ngCordovaUntappd","$ngCordovaDribble","$ngCordovaPocket","$ngCordovaMercadolibre","$ngCordovaXing","$ngCordovaNetatmo","$ngCordovaTraktTv","$ngCordovaYahoo"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f,g,h){var i=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled()){var j="http://localhost/callback";void 0!==h&&h.hasOwnProperty("redirect_uri")&&(j=h.redirect_uri);var k=window.cordova.InAppBrowser.open("https://www.linkedin.com/uas/oauth2/authorization?client_id="+d+"&redirect_uri="+j+"&scope="+f.join(" ")+"&response_type=code&state="+g,"_blank","location=no,clearsessioncache=yes,clearcache=yes,allowinlinemediaplayback=YES");k.addEventListener("loadstart",function(a){if(0===a.url.indexOf(j))try{var c=a.url.split("code=")[1].split("&")[0];b({method:"post",headers:{"Content-Type":"application/x-www-form-urlencoded"},url:"https://www.linkedin.com/uas/oauth2/accessToken",data:"client_id="+d+"&client_secret="+e+"&redirect_uri="+j+"&grant_type=authorization_code&code="+c}).success(function(a){i.resolve(a)}).error(function(a,b){i.reject("Problem authenticating")})["finally"](function(){setTimeout(function(){k.close()},10)})}catch(f){setTimeout(function(){k.close()},10)}}),k.addEventListener("exit",function(a){i.reject("The sign in flow was canceled")})}else i.reject("Could not find InAppBrowser plugin");else i.reject("Cannot authenticate via a web browser");return i.promise}return{signin:d}}angular.module("oauth.linkedin",["oauth.utils"]).factory("$ngCordovaLinkedin",a),a.$inject=["$q","$http","$cordovaOauthUtility"]}(),function(){"use strict";function a(a,b,c){function d(d,e,f){var g=a.defer();if(window.cordova)if(c.isInAppBrowserInstalled())if("undefined"!=typeof jsSHA){var h={oauth_callback:"http://localhost/callback",oauth_consumer_key:e,oauth_nonce:c.createNonce(5),oauth_signature_method:"HMAC-SHA1",oauth_timestamp:Math.round((new Date).getTime()/1e3),oauth_version:"1.0"},i=c.createSignature("POST",d+"/oauth/initiate",h,{oauth_callback:"http://localhost/callback"},f);b.defaults.headers.post.Authorization=i.authorization_header,b.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded",b({method:"post",url:d+"/oauth/initiate",data:"oauth_callback=http://localhost/callback"}).success(function(a){for(var e=a.split("&"),i={},j=0;j