google-oauth2

How to Log User out of an App that uses Google OAuth2 Sign-In?

本秂侑毒 提交于 2019-12-02 01:24:45
I've implemented a Google OAuth2 login flow in my web-server app (using python/flask). My app redirects the user to Google, where they sign in with Google credentials and get directed back to my app. I'm having trouble deciding how to implement the Logout functionality for this app. I can clear the app's session cookies, but that doesn't log the user out of their Google a/c. So if the user hits Login after logging out, the redirect goes to Google and since the user is still signed into Google, they're automatically (without even being prompted to re-enter credentials) signed back in to my app.

Google Actions - Access to Calendar API with access token fails

邮差的信 提交于 2019-12-01 23:02:48
I followed the instructions in this great post , to setup account linking between my app's server and google actions. In the auth process, I requested " https://www.googleapis.com/auth/calendar " scope permission. I managed to get the auth token on my server by calling app.getUser().accessToken But when I make a request to googleapi calendar, using this piece of code: const google = require('googleapis'); var calendar = google.calendar('v3'); var eventData = { auth: myAuthToken, calendarId: 'primary', resource: { 'summary': 'My Event', 'description': 'Event desc', 'start': { 'dateTime': '2017

Use a .p12 File from classpath for GoogleCredential

匆匆过客 提交于 2019-12-01 19:31:23
I am making a java command line application packaged in a single JAR file that uses some of Google's API. I need to set up a GoogleCredential object from a private key "Credentials.p12". GoogleCredential credential = new GoogleCredential.Builder() .setTransport(httpTransport) .setJsonFactory(jsonFactory) .setServiceAccountId("xxxxx@developer.gserviceaccount.com") .setServiceAccountScopes(Arrays.asList(DirectoryScopes.ADMIN_DIRECTORY_GROUP, DirectoryScopes.ADMIN_DIRECTORY_USER, DirectoryScopes.ADMIN_DIRECTORY_ORGUNIT)) .setServiceAccountUser(emailAccount) //THE CODE BELOW IS IMPORTANT: I need

How do use ngrok in conjunction with Google Oauth?

风格不统一 提交于 2019-12-01 15:02:05
问题 I recently installed Ngrok in order to test my localhost meteor App on my phone. I am successful in accessing the meteor app via a tunnel by ngrok. However when I try to login using I get this error message: The login process shows the following error message: 400. That’s an error. Error: redirect_uri_mismatch Application: AppName You can email the developer of this application at: my@emailadress.com The redirect URI in the request, http://localhost:7123/_oauth/google, does not match the ones

Can't access my profile data when accessing google-people API

瘦欲@ 提交于 2019-12-01 12:50:18
I want to implement Google Oauth2 on my project. My main goals are accessing the google-people API in order to display profile information, and google drive. Because I'm new with this, I activated several APIs and -most of the times- succeeded in getting info. Only the People API is causing me problems, and I don't get why. Here is what I'm doing (I'm skipping all the login part). Defining the scopes: $client->addScope("https://www.googleapis.com/auth/drive"); $client->addScope("https://www.googleapis.com/auth/youtube"); $client->addScope("https://www.googleapis.com/auth/contacts"); // this is

Can't access my profile data when accessing google-people API

拜拜、爱过 提交于 2019-12-01 11:54:11
问题 I want to implement Google Oauth2 on my project. My main goals are accessing the google-people API in order to display profile information, and google drive. Because I'm new with this, I activated several APIs and -most of the times- succeeded in getting info. Only the People API is causing me problems, and I don't get why. Here is what I'm doing (I'm skipping all the login part). Defining the scopes: $client->addScope("https://www.googleapis.com/auth/drive"); $client->addScope("https://www

Accessing G Suite Admin SDK using service account

假如想象 提交于 2019-12-01 08:19:34
I am trying to use a service account to access Directory API ( https://developers.google.com/admin-sdk/directory/v1/reference/users/list ). The simplest task is to list users in the organization. That works well with my user account, tested with the OAuth 2.0 Playgorund. But I need to use service account. I am following documentation for two-legged OAuth ( https://developers.google.com/identity/protocols/OAuth2ServiceAccount ) and implementing REST client in Powershell API Access enabled in Google Admin Console The service acount is created and P12 credentials downloaded. The account is

Cross-platform Google OAuth Signin: redirect_uri mismatch

霸气de小男生 提交于 2019-12-01 06:11:17
问题 I use Google OAuth for authenticating users on my application and face an issue with redirect_uri to support multiple client apps. On the server-side, I provide a REST API which uses the Google PHP SDK, the login flow is almost similar to what's described here: https://developers.google.com/identity/sign-in/web/server-side-flow I have two client apps: a website using the JavaScript SDK and an Android app using the android client, implemented as https://developers.google.com/identity/sign-in

Google Admin SDK 403 Not Authorized to Access this Resource/API

你。 提交于 2019-12-01 05:31:18
问题 I use the following code in a java web application to try to get all users of a group: GoogleCredential credential = GoogleCredential.fromStream(Util.class.getResourceAsStream("[credential_file].json")).createScoped(SCOPES); Directory directory = new Directory.Builder(httpTransport, JSON_FACTORY, credential).build(); Directory.Members dirMem = directory.members(); Members members = dirMem.list("[group_email]").execute(); This results in an exception 403 (Not authorized to access this resource

How to force account login for a single account user with Google's OAuth 2.0?

我们两清 提交于 2019-12-01 05:28:25
Sometimes when a user logins into a site with Google's OAuth 2.0 they choose the wrong account to login with. Normally this isn't a problem if the user has more than one account registered with the browser, google will automatically show the user select screen: But if a user has only one account and is logged in, this screen is skipped. Instead I need Google's sign in panel to always appear, so that I can be sure the user has the option to try and enter the correct account. I tried using approval_prompt = "force" , but that forces the acceptance of permissions rather than simply showing the