Can someone tell me why I can't use the same token to retrieve userInfo and calendars list from Google?
I have set the correct scopes (I think):
private static final String PLUS_ME_SCOPE = "https://www.googleapis.com/auth/plus.me";
private static final String USER_INFO_PROFILE_SCOPE = "https://www.googleapis.com/auth/userinfo.profile";
private static final String USER_INFO_EMAIL_SCOPE = "https://www.googleapis.com/auth/userinfo.email";
private static final String GOOGLE_CALENDAR_SCOPE = "https://www.googleapis.com/auth/calendar";
To get the user info I use this url: https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token= and for calendars I use: https://www.googleapis.com/calendar/v3/users/me/calendarList?minAccessRole=writer&key= .
In user Info I get all the correct info but for the calendar I get Error 401 : Login Required.
What's wrong in here?
Change
to
Just that simple ;)
UPDATE:
Also note, that it is not recommended to specify the access token as a query parameter: