sirkitree / angular-directive.g-signin

:triangular_ruler: AngularJS Directive for Google Plus Sign-in Button
http://jeradbitner.com/angular-directive.g-signin/
148 stars 84 forks source link

modified to inglude Google OAuth2 sign in #42

Closed devasur closed 9 years ago

devasur commented 9 years ago

Ran into a serious issue with Google+ button login last week. Because of some changes on the Google side it just started to auto login users. None of my efforts to configure the button to behave nicely worked. Ended up changing the login to use the alternative and recommended Google Signin Button

https://developers.google.com/identity/sign-in/web/sign-in

Works nicely now. I have modified the code to work with the global event listener paradigm of the original code. One great benefit of using this approach is that even on localhost logout works nicely.

Check it out. Currently in use on our production code https://walkinto.in

devasur commented 9 years ago

@sirkitree Might want to take a loot at this?

sirkitree commented 9 years ago

I do, just haven't had time to test and I'll be gone today and all weekend as well. This will require a major version bump. If anyone can test before I get back I should certainly have time next week.

sarbjeetsingh commented 9 years ago

i am getting this error with your code, can you please tell me whats wrong

Uncaught gapi.auth2.ExternallyVisibleError: Missing required parameter 'client_id'

devasur commented 9 years ago

@sarbjeetsingh ClientId is the parameter you get for this Auth setup from your https://console.developers.google.com for your project. You pass it as an attribute to your Usually in the format of *.apps.googleusercontent.com

Barryrowe commented 9 years ago

I will be testing this today and report back on how it goes.

Barryrowe commented 9 years ago

@sarbjeetsingh btw, the error you're getting is because the new platforms script appears to expect the clientid to be set in a meta tag like:

<meta name="google-signin-client_id" content="YOUR_CLIENT_ID.apps.googleusercontent.com" />

If I can get this working I'll try and add to extend this to dynamically generate that tag based on the directive attribute before loading the platforms script.

Barryrowe commented 9 years ago

FYI, I just submitted a Pull request to @devasur to extend his changes a little bit further. I've tested the auth2 changes and they work well. See PR https://github.com/devasur/angular-directive.g-signin/pull/1

sirkitree commented 9 years ago

Cool, I'll merge once they get in here.

Barryrowe commented 9 years ago

I don't know if @devasur is maintaining his fork. If you'd like @sirkitree I can submit a PR to a new branch on this repo.

sirkitree commented 9 years ago

That would also be acceptable. Thank you.