I have a web application that has frontend built on EmberJS and backend in Java.
I'm making the user sign in using Google OAuth and requesting the scope: https://www.googleapis.com/auth/calendar
{
"El": "google_user_id",
"Zi": {
"token_type": "Bearer",
"access_token": "access_token",
"scope": "openid email profile https://www.googleapis.com/auth/calendar.readonly https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/calendar",
"login_hint": "login_hint",
"expires_in": 3600,
"id_token": "..AF16AF6oc7Fl2uv5V9r",
"session_state": {
"extraQueryParams": {
"authuser": "0"
}
},
"first_issued_at": 1550770587899,
"expires_at": 1550774187899,
"idpId": "google"
},
"w3": {
"Eea": "google_user_id",
"ig": "Shivang Tripathi",
"ofa": "Shivang",
"wea": "Tripathi",
"Paa": "https://mnsbfsdbf/photo.jpg",
"U3": "[email protected]"
}
}
Now, I send this response to the server. The server can use the provided "access_token" to do various tasks like get calendars list, etc by making API calls using REST. Eg. Making a call to https://www.googleapis.com/calendar/v3/users/me/calendarList with "access_token" as Authorization Header.
I'm running into a problem though.. The token is short lived and expires in 60 minutes.
Can I somehow extend this token to never ending token or long lived token? Facebook allows this: https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing Can someone tell me if Google allows this from server side and how?