google-authentication

GAE AttributeError: 'Credentials' object has no attribute 'with_subject'

◇◆丶佛笑我妖孽 提交于 2019-12-05 19:19:32
I have a python app I want to deploy on App Engine (2nd Generation Python 3.7) on which I use a Service Account with Domain-wide delegation enabled to access user data. Locally I do: import google.auth from apiclient.discovery import build creds, project = google.auth.default( scopes=['https://www.googleapis.com/auth/admin.directory.user', ], ) creds = creds.with_subject(GSUITE_ADMIN_USER) service = build('admin', 'directory_v1', credentials=creds) This works good and, as far as I know it is the current way to do this when using Application Default Credentials (locally I have GOOGLE

Easiest way to enable Google authentication for GWT application? (non-GAE-hosted)

天涯浪子 提交于 2019-12-05 16:49:04
What is the easiest way to enable existent GWT application authenticate users using Google account? I tried googling (lol) it but have found no solutions that could work out of the box. Is there a library to solve this problem in like 10 lines of code? P.S. The application I've mentioned isn't hosted at Google Apps if it matters. I have been looking at gwt-oauth2 for this purpose recently. It looks pretty decent, and the docs are straightforward. Perhaps it could be of interest. 来源: https://stackoverflow.com/questions/7517327/easiest-way-to-enable-google-authentication-for-gwt-application-non

Access Google spreadsheet API without Oauth token

拜拜、爱过 提交于 2019-12-05 13:18:20
I've read google spreadsheet documentation https://developers.google.com/sheets/api/guides/authorizing And it says, that if document is public, you don't need Oauth 2.0 and API key is sufficient. I'm trying to do a test request with hurl and api key as parameter.it, but it still gives me error, that I need to use Oauth, any thoughts? POST https://sheets.googleapis.com/v4/spreadsheets/16woR-nfy6KYBbkQpC2YOT1GzIean8rTzjueUnlzLMiE/values/Sheet1!A1:E1:append?valueInputOption=USER_ENTERED Response: "error": {"code": 401,"message": "Request is missing required authentication credential. Expected

'com.google.android.gms.common.api.GoogleApiClient' is deprecated

和自甴很熟 提交于 2019-12-05 11:17:22
I'm using in my app Google sign-in method and I have updated today my dependencies to: implementation "com.google.firebase:firebase-core:17.1.0" implementation "com.google.firebase:firebase-auth:19.0.0" And I stared to get warnings about deprecated classes. Warning:(26, 12) 'com.google.android.gms.common.api.GoogleApiClient' is deprecated And Warning:(27, 36) 'com.google.android.gms.common.api.GoogleApiClient.Builder' is deprecated This is my code: static GoogleApiClient provideGoogleApiClient(Application app) { //deprecated return new GoogleApiClient.Builder(app) //deprecated .addApi(Auth

Android Studio - GoogleAuthUtil cannot be resolved

大兔子大兔子 提交于 2019-12-05 10:02:43
I'm using Android Studio. I need to use Google Accounts, but I'm getting an error. Cannot resolve symbol 'GoogleAuthUtil' I've imported the four main imports. import com.google.android.gms.auth.GoogleAuthException; import com.google.android.gms.auth.GoogleAuthUtil; import com.google.android.gms.auth.GooglePlayServicesAvailabilityException; import com.google.android.gms.auth.UserRecoverableAuthException; Here's how I'm calling it. final Account[] accounts = mAccountManager.getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE); My AndroidManifest.xml has the following. <uses-sdk android

Google Sign-In via Firebase: GIDSignInDelegate does not conform to ViewController

隐身守侯 提交于 2019-12-05 08:44:17
I'm introducing Google Sign-In to my app and whilst both Google and Firebase documentation is thorough enough, what I have done as they suggested is not sufficient... I am still getting this error. Hopefully this will help others with finding a solution to the problem when implementing their SDK....thanks in advance for reviewing this chunky one: Here's the Firebase guide and the Google guide: So Added Google to podfile - CHECK Added line into Bridging-Header - CHECK Added GoogleService-Info.plist & bundle identifier & reversed client ID to URL schemes - CHECK App Delegate has the following,

Google play services sdk: Requesting for offline access during auth

廉价感情. 提交于 2019-12-05 02:56:51
问题 Is there a way to request for offline access using the Google play services sdk on android? I know that the raw HTTP api has an option to do this by requesting for a refresh token, but couldn't find a way to do it via the new Google Play services sdk. The new sdk gives the app an access token using the GoogleAuthUtil.getToken() method, but the access token expires every hour. I could make the raw http request and have the user sign in from a web view or the browser, but would prefer a way to

How to determine if the user signed in to Firebase with email and password or with google sign in?

馋奶兔 提交于 2019-12-05 00:34:42
问题 I am working on a log in for a web application, and I have made it so the user can sign in manually with their email and password or by using a google sign in. Is there a way to determine which method they used? Preferably by using the Firebase authentication state change function. `firebase.auth().onAuthStateChanged(firebaseUser => {....` I know you can tell how they signed in when you go into the Firebase console log but is there a way to determine it using JavaScript code? When using

Android, Google Drive: Google consent screen freezes

↘锁芯ラ 提交于 2019-12-04 18:41:09
I've upgraded my app to the Google Drive REST API and its Java wrappers, as described here: https://developers.google.com/drive/android/deprecation My code is very close to the official demo app provided by Google. I also cross-checked with other code examples I've found. The Google Drive API upgrade itself was successful, but now there are very few users that cannot log-in anymore. The Google consent screen displays a white box and the circle is rotating. No information is displayed at all. On the code side the app receives the callback that something failed. No further information. No chance

com.google.android.gms.auth.GoogleAuthException: getToken(Unknown Source) exception

北慕城南 提交于 2019-12-04 17:31:49
问题 In my Android application, I am trying to get google token to verify at my google app engine backend server. But I always get this exception : com.google.android.gms.auth.GoogleAuthException: getToken(Unknown Source) exception My code : private Account mAccount = AccountManager.get(this).getAccountsByType(GoogleAuthUtil.GOOGLE_ACCOUNT_TYPE)[0]; private static final String SCOPE = "audience:server:client_id:" +Constants.WED_CLIENT_ID; String token = GoogleAuthUtil.getToken(LoginActivity.this,