1

I am having problem implementing Google Plus Web Server authentication

https://developers.google.com/accounts/docs/OAuth2WebServer

I have implemented most of the steps, until the last step, I have no idea how to make a callback with token to my Angular.JS,

I found an article which solves my problem (and it has the same implementation as mine):

http://apicatus-laboratory.rhcloud.com/2014/04/13/handling-oauth-callbacks-in-spa/

But, I have few questions for this article,

  • is this way legit??? or any other security flaws that I need to consider?
  • what is the normal way to do it? if I dont want to use Google SDK, cookie and session to send the token back to my Angular, what other possible ways to send token to my Angular app?
  • how the normal angular app handle the callback?

1 Answer 1

2

Why not use this flow that is meant for javascript applications?

https://developers.google.com/+/web/signin/javascript-flow

& https://developers.google.com/accounts/docs/OAuth2UserAgent

You can get an id_token (it is JWT) directly from Google in JS and use that.

What the article is trying to do is to get the Google Oauth response to the server and issue it's own JWT just like any site would issue its own authentication cookies and use those in the application.

Both are possible options depending on the goal of your application.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.