mrzmyr / angular-google-plus Goto Github PK
View Code? Open in Web Editor NEWAngular module which handles the login with the Google+ API
License: MIT License
Angular module which handles the login with the Google+ API
License: MIT License
How can I get the allready logged in user when the page is refreshed?
I want to integrate GooglePlus oAuth into a third party data provider, but to do this I need the full content of the original auth response with the access_token and the expires_in fields.
Why is this library cleaning that out? Please leave it in.
GooglePlus.logout() is throwing the error "Cannot read property 'clear' of null"
not able to fetch mail id of the longeing user please get me some function which will return data with mail id,
right now
GooglePlus.getUser().then(function (user) {
debugger;
});
function is not returning mail id in some of the user.. but in some cases is working fine.
please update me on that.
Hi,
I am trying to use it in my application using browserify, but i am getting following error:
Error: [$injector:modulerr] Failed to instantiate module googleplus due to:
Error: [$injector:nomod] Module 'googleplus' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument
I have installed it in local and global.
thank you
According to this article (https://aaronparecki.com/2012/07/29/2/oauth2-simplified), the client secret must be kept confidential. If a deployed app cannot keep the secret confidential, such as Javascript or native apps, then the secret is not used. However, in this application, we need to use API_KEY in the javascript. Is it actually a good idea? Would it lead to security issues?
When creating an offline
authorization request I'm not able to access the refresh_token
.
Is there any way to get the user's E-mail using this module?
I add 'getEmail' function which does following..
gapi.client.request({path:"plus/v1/people/me"}).execute(function (res) { ... };
and use this scope : "https://www.googleapis.com/auth/plus.profile.emails.read"
Anyone know another way without modifying existing source.?
Is it possible to set the language? I have an American traveling in Thailand who's testing my site, but the login prompt is displaying in Thai. It seems like Google automatically bases the language on location/IP address rather than what's set in the browser / computer. If he applies &hl=en to the end of the sign-in popup's URL, it shows up in English. Basically, I'd like to be able to pass the hl value based on what I detect as the users language.
Anyone know why Google does this? If a potential American user is on vacation in Mexico, they'll see the consent form in Spanish rather than English. There must be a reason they do this, but I don't know why.
According to the documentation (here), how i can find the following informations : placesLived and birthday ?
Because when I set the scope : https://www.googleapis.com/auth/plus.me
GooglePlusProvider.setScopes('profile email https://www.googleapis.com/auth/plus.me');
The response data of getUser() returns me basic informations without extra ...
Currently I only changed your checkAuth function to the following (added $q):
NgGooglePlus.prototype.checkAuth = function() {
deferred = $q.defer();
gapi.auth.authorize({
client_id: options.clientId,
scope: options.scopes,
immediate: true
}, this.handleAuthResult);
return deferred.promise;
};
So when the user is loaded my app, I can check in angular run function if the user is already authorized or not:
var checkGoogleReady = $rootScope.$watch(function() {
if(typeof gapi === 'object' && typeof gapi.auth === 'object') {
console.log('Google API is loaded');
checkGoogleReady(); // clear watcher
GooglePlus.checkAuth().then(function () {
console.log('User is already authorized');
}).catch(function () {
console.log('User is not authorized');
});
}
});
Do you have better solution for this? Can you extend your module to check if user is already authorized or not?
GooglePlus.logout() seems not to have significant effect as next time I execute .login, no username/password is asked.
Repro:
I want to use Google plus login in my angular 2 app.. So anyone can help me out please ๐
Tested in Firefox and Safari.
Procedure to replicate:
Log into an account in Gmail.
Log into an app using angular-google-plus
Log out of that app.
Log out of Gmail
Attempt to log back into the app.
The app will log you in, but the window to log into a Gmail account will still appear. If an attempt is made to log in using this window, future log-ins will fail until the browser is restarted. Similarly, restarting the browser at any time after step 4 will resolve the issue.
We found that incorporating this module significantly slowed down our Angular 1.5 karma-jasmine tests. Since the run block of angular modules are automatically executed for every test we found that the google client.js was repeatedly inserted and loaded and this slowed down the tests. This duplicate client loading could be avoided if the angular-google-plus run function would check to see if gapi was already loaded before proceeding with the google client script insertion.
Like this:
{
:provider => 'facebook',
:uid => '1234567',
:info => {
:nickname => 'jbloggs',
:email => '[email protected]',
:name => 'Joe Bloggs',
:first_name => 'Joe',
:last_name => 'Bloggs',
:image => 'http://graph.facebook.com/1234567/picture?type=square',
:urls => { :Facebook => 'http://www.facebook.com/jbloggs' },
:location => 'Palo Alto, California',
:verified => true
}
}
Cause in previous commits you removed useful info like name or link.
The definition of the options object that will contains the information of keys and scopes should be placed inside the module.
Actual:
/**
* Options object available for module
* options/services definition.
* @type {Object}
*/
var options = {};
/**
* googleplus module
*/
angular.module('googleplus', []).
/**
* GooglePlus provider
*/
provider('GooglePlus', [function() {
Must be changed to
/**
* googleplus module
*/
angular.module('googleplus', []).
/**
* GooglePlus provider
*/
provider('GooglePlus', [function() {
/**
* Options object available for module
* options/services definition.
* @type {Object}
*/
var options = {};
This will prevent any collision of the variable options when use several libraries in your application.
There seems to be a bug in the signout function.
The " return deferred.promise;" is causing "Cannot read property 'promise' of undefined".
After an hour of inactivity, my app times out and returns the user to the log-in page. If, here, the user attempts to use the google+ sign-in, they receive back an error code 401, with a message of 'Invalid Credentials'. If the time at which the app times out is shortened (to, for instance, 10 seconds), then in that case, the google+ sign-in appears to work fine.
First off, great app.
The one issues,
*) First, I purposely cause a failure by clicking CANCEL on the Google Popup. The promise is resolved correctly as reject / error
*) The second time I login to Google, I accept. Expected result is success, token and my user data. Result is error.
*) logging in a second time causes successful result.
*) Reversing my sequence, Succeeding and then failing causes a similar problem (promise resolves to give me old Auth Token and my data)
Stepping through, I found on second run the promise is instantly resolved without waiting for Google. This seems to be a case Angular Promises being cached. This is particularly interesting since the promise IS correctly bound when Google returns it. It just doesn't wait for the response so I get the cached answer.
I know how to turn off caching when using the $http service, but I don't know how to do so with the $q service.
The version being pulled from Bower is marked 0.1.2, but the files appear different. I noticed this issue when I tried to use the server side sign-in support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.