php - gplus authenticate a client-side user before submitting to my web app -


This is more than a process question question in an error code, please kindly please if I posted to the wrong place.

I have successfully authenticated a jeepless user client-party so that the browser can create a Google ID to use for me. Now I want to post some data on my website as a user ID from that ID but I want to secure it which means that I am not able to post someone on your web app with someone else's Jolly ID I want (it should be authenticated user at that time)

Should I install the PHP Server Sidek SDK and use it? If this is the case, how can I merge client-side data with it?

Thank you

You are absolutely sure about obtaining an ID in a safe way It is difficult to clone it so it is difficult to clone. There are two main options, both properties of authResult object that return to the signed callback:

  1. Send 'code' to the server. It is part of the OAuth 2.0 flow, and can be exchanged on the server side for an access token. With that you can create API calls as a user, and retrieve user IDs and other details. You can be sure who the user is, because only Google could have prepared that code. This would involve using one of the client libraries to handle this token exchange. Use the 'id_token' This is the base 64 encoded blob of JSON that contains the User ID (and the email address if you request the 'Email' field). What makes it secure is that it includes a cryptographic signature, which can verify the server, so it can not be made by someone other than Google ID token is used to get the user ID, and its use Can be used to view the user on the server, but the API does not allow to make calls. The advantage of this is that verification requires only the date certificate which does not change this often, so most calls do not require any network traffic from the server to confirm the user.

    Whatever you use depends on you, but both will need some code on the server. In general, if you call the server to any Google API Do not need to do it, or if you are worried about maximum login performance then use id_token. Here's a bit more information about this type of architecture:

    You can also add both of them. The first time a user signs in (when they see the consent screen) the code exchange will not only return an access token (to call) but will also give a long refresh token, which you store safely in the database can do. If you store it, you can use the id_token to quickly see the user, but still use the fresh token to help with API access.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -