Firebase auth web with apple login - ios

I'm stuck on configuring Apple Login for my web app using Firebase Auth.
I did all the configuration on https://firebase.google.com/docs/auth/web/apple but cant seem to find the apple-developer-domain-association.txt file to download and host on firebase hosting.
Firebase configuration:
Services Id:
- The bundle id on the identifier page
Apple Team Id:
- Full App name
Key Code:
- The key identifier
Secret Key
- Content of key file downloaded from the developers page
With this config I get the invalid_uri on the popup when opened.
Can anyone help?
Thanks in advance.

In addition to Ruaridh's answer, make sure that the "domain" is formatted with OUT the leading "https://"
so just: YOUR_FIREBASE_PROJECT_ID.firebaseapp.com
This may seem obvious to some, but I did not see anything in any documentation that specified the format the domain needed to be in. Even Firebase and Apple support were not able to identify improper formatting as an issue in my case. I came across this solution by accident and still cannot find any official documentation of formatting.
I had been stuck on that for a while, so even if it doesn't solve your issue, hopefully it is valuable to others.

You shouldn't need to host the apple-developer-domain-association.txt on Firebase anymore - I have just implemented Sign in with Apple on a Firebase web app and it wasn't required. Apparently as long as TLS 1.2 is supported (which Firebase handles for you), it should work. Firebase docs seem to be out of date. When configuring your Service ID, it says:
Your website must support TLS 1.2 or higher.
You should just need to register https://YOUR_FIREBASE_PROJECT_ID.firebaseapp.com/__/auth/handler in the "Return URLs" when configuring the Service ID in the Apple Developer Console.
Note that Apple doesn't let you use localhost as the return uri, so I found that I couldn't test it locally either.

Related

Xamarin google play services login setup

I am trying to hook a Xamarin project up to Google Play Services but keep receiving a SIGN_IN_REQUIRED error when calling Connect. I have read a few posts online but cannot determine what actually causes this error message.
I have setup the a game project and also setup an API with oAuth credentials. I have made sure that the same SHA key is being used in the API credentials and in the application while debugging but I am still not making any progress.
I am currently presuming that this is not a coding problem but rather something to do with the setup of the API services etc but have ran out of things to try at this point.
Firstly, to make sure your network connection is normal, you can run this demo in your network environment.developer.xamarin.com/samples/monodroid/google-services/… Donnot forget to change to clientID in string.xaml.Then , open the firebase console, find this app check the clientID if it is same with your code, and check the SHA-1 hash of your signing certificate.

Custom scheme URIs are not allowed for 'Web' client type - Google with Firebase

I am trying to implement google sign in using firebase in to my iOS app. I follow this tutorial.
https://firebase.google.com/docs/auth/ios/google-signin
I have setup the iOS app in firebase and use the google clientID and reversedClientID from the dowloaded GoogleService-Info.plist.
FYI: I have a custom sign-in button instead of the google sign in button. Anyway when i click the sign in button, google following error display in a webview.
I know my problem is the same as which described in this question.
Google 400 Error: invalid request Custom scheme URIs are not allowed for 'Web' client type
But, in my case, I have created the app in Firebase still I get the error. Any idea please...
The first step is to check if you have already the OAuth 2.0 ID for iOS. To do this please open the Credentials page in the API Console. I hope you will find iOS client for your application under OAuth 2.0 client IDs section. If not, please follow this Guide
The second step is to replace the Web Client ID with in iOS Client ID from OAuth 2.0 client IDs section. To do this, you should open the GoogleService-Info.plist and modify following keys: CLIENT_ID with [value].apps.googleusercontent.com and REVERSED_CLIENT_ID with com.googleusercontent.apps.[value].
if you're using flutterfire ui package you need to change the client id parameter in your GoogleProviderConfiguration class with the iOS client id,
you can copy it from here Credential page
example:
providerConfigs: [
GoogleProviderConfiguration(
clientId: "your copied key here"),
]
re-build you're app and you should be good to go
I've just faced this same issue using flutterfire_ui on Flutter.
The error appears to be from a couple of things. As Valeriy points out you need the ios client ID. But I still got the error if I used the scopes
openid
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/userinfo.profile",
Instead change these to
openid
email
profile
Strangely the opposite is true for Android, where the WebID and the first of the scopes should be used.
It also pays to be aware of the OAuth Content Screen..
In google cloud go to APIs & Services > OAuth consent screen > Edit.
You can add scopes here and fix any missing required fields that Firebase might not be filling out (I had 1). I believe this takes a while to propagate after a change, so give it an hour.

Firebase 3 Password Recovery Link Not Working

I've been working on my app with Firebase for several months now. I hooked up the password reset code about 5 months ago and when I would test it, I'd get the password rest email sent, click the link and everything would work fine. I haven't signed in with that particular account in 5 months so I forgot the password. Now when I get the pw reset email everytime I click the link I repeatedly get:
Try resetting your password again. Your request to reset your password
has expired or the link has already been used
I'm using Firebase 3 via cocoapods as of Aug 2016 and never upgraded or installed anything from any of the older versions. I'm also using swift 2.2, Xcode 7.3.1.
I would upload code but everything is working fine because the email is getting sent, the problem seems to be on FB's end.
What's the issue?
This is an update for anyone who runs into this problem. This is the response Firebase tech support sent back. It isn't the answer but rather an idea of what they'll ask you if you have the same problem. You get up to 5 free questions per 365 days so why waste one.
Hi there,
Could you please try resetting your password on your console and let
us see if it works there. Also, did you generate a new API key for
your project? If yes, then it's possible that your old API key is
still being used by your app. Could you please check whether the API
key is same? The API key from your Firebase project and your app
should be the same.
Please update your app's Firebase config and check if the API keys
match your console's. For Android, download the updated
google-services.json file. See more details here. For iOS, download
the updated GoogleService-Info.plist file. See more details here. For
Web, follow the config as seen in the docs. If the steps above still
doesn't work, please provide the details below to further investigate
the issue. Old API key and new API key used. Platform and Firebase SDK
version used? Date and time you started encountering this issue. Error
logs and full stack trace. Screenshots of your API keys. Let me know
if you have any other Firebase related issues/questions. Thank you for
using Firebase. :)
I actually had another API key inside my console that was never used. I deleted it like they suggested and the Firebase Recovery email was still broken. I changed my Google.Console password and it still didn't work. I sent them all the required information. As soon as I get a response and hopefully a resolution I'll post it.
I had the same problem. I couldn't understand why and then I realised something... as it was new environment, I exported users from another environment and on this one, I just forgot to activate authentication by email...
My mistake but I thing Firebase should make it clearer in their error warnings.

Google 400 Error: invalid request Custom scheme URIs are not allowed for 'Web' client type

When I am signing into Gmail in my iOS App, I am getting the below error (screenshot) and the sign-in fields do not appear. We are loading the sign-in screen in a WKWebView.
We are using a custom URI redirect but why is google throwing this error now. What are the alternatives to a custom URI?
Swift 2.3 project
Using OAuthSwift v0.6.0 cocoapod
This started quite recently only in the past week or so I believe something changed with Google's APIs.
I have read that google is deprecating webviews for OAuth and will block requests on April 20, 2017. As seen here in a Google Developers Blog:
https://developers.googleblog.com/2016/08/modernizing-oauth-interactions-in-native-apps.html
Does this mean I already need to use or is there another viable solution? I thought I had more time before needing to update this.
My guess is that your client is registered incorrectly in Google Cloud Console. A 'WEB' client is typically a server or Javascript application. An iOS app should be registered as an iOS client.
https://developers.google.com/identity/protocols/OAuth2InstalledApp#creatingcred
I Just found this problem too.
Please check google developer console and look at the credentials keys
Your Client ID in google-info plist must come from iOS application, not the web.
And use that Client ID to be revereseClientID and copy it in to URI type
I have solved the problems by create project in Fire Base Because REVERSED_CLIENT_ID generate from developers.google.com Incorrect.
Try create your project in FireBase
https://console.firebase.google.com
you must cross check clientId at your 'Google Dashboard' clientId and clientId at "GoogleProject.Plsit".if both are different, copy ClientID from 'Google Dashboard' and paste it on "GoogleService-Info.Plsit".and also amend your reverseClientId in "GoogleService-Info.Plsit" according to newly pasted ClientID(you check the pattern how reverseClientId created from client Id in "GoogleService-Info.Plsit"). And then paste thid reverseClientId in 'URL type' in your project setting.
In case of mine clientId on "GoogleService-Info.Plsit" and my 'Google Dashboard' were different.
chech your google dashboard here : https://console.developers.google.com/apis/credentials?project=firebase
I just experienced this issue following the Google Signin for iOS Guide. The plist generated file is not the good one. You need to take a look at the clientID and reversedClientID and be sure that they are the ones for the iOS app on your Google developer portal.
I faced this error after previously creating a GoogleService-Info.plist file using the site Google Sign In directs you to. I later started using Firebase, which seems to create a separate .plist file. After attempting to include Firebase's new .plist file, my Google Sign In button started yielding the invalid_request error with the Custom scheme URIs are not allowed for WEB client type message.
In order to fix the problem I tried many things, but in the end deleting MY ENTIRE Firebase project on their web console (not just the individual app), recreating a new Firebase project from scratch, and re-downloading the new .plist file, solved the error.
It creates two client ID. one for web and one for iOS application. Web client will be in the google plist by default. So it gives the above error. Use iOS Client id from google console or create credential for iOS application.
For my experience, I had followed Google's SignIn iOS Swift guide and had downloaded a Web OAuth JSON file. They literally provide you the wrong Plist file for an iOS setup.
Just in case somebody else runs into this issue here are the steps I followed:
Go to the Google Developers console.
Go to the Credentials section.
Notice there are two items in the "OAuth 2.0 client IDs" section. (If you previously attempted to configure an iOS Google SignIn project.
Click on the name of the "iOS client for ".
Click "Download PLIST File".
Delete the Google web Plist file from your project.
Drop in the new iOS based Plist file.
Copy over the new REVERSED_CLIENT_ID into your URL Types of the Info page of your project. (This is detailed in Google's guide).
Attempt to run your app again.
Note: I got the Google Sign In API to work with Swift v3 and XCode v8.
I was getting the same error. Then I figured out, that I did not provide my app Bundle Id to access the Google Sign In Service in my app.
You do that from the page with the link:
https://developers.google.com/mobile/add?platform=ios&cntapi=signin&cnturl=https:%2F%2Fdevelopers.google.com%2Fidentity%2Fsign-in%2Fios%2Fsign-in%3Fconfigured%3Dtrue&cntlbl=Continue%20Adding%20Sign-In
1.Sign in with your Google Developer account.
2.Create you app name and copy the App bundle Id from your project from:
Project and Target List> General> Bundle Identifier.
3.Choose your Country
4.Enable Google- Sign In.
Then perform the necessary steps to integrate Google Sign In in with your iOS App.
I was facing the same issue. I followed all the instructions to integrate my app several times, and played with the code to see if there was any hidden issue in the code.
I downloaded and configured the sample app from google at github https://github.com/googlesamples/google-services and go the same issue, so it was not the code.
It seemed like there is something in my console configuration so I switched between different google console apps, and played changing the bundle IDs.
The only thing that managed to fix this issue was to use Firebase instead. I created an app in the firebase console, downloaded the new plist, and it worked.
Still not sure why this didn't work for me in the first place, this doesn't seem to be a common problem, but I hope this helps someone.
cheers,
Kindly check console.developers.google.com/apis/credentials for your project and see whether there is already a client_id in OAuth 2.0 client IDs section , if so then copy that client id and replace it with you GoogleService-Info.plist file's CLIENT_ID and accordingly change REVERSED_CLIENT_ID (in reverse manner) now clean and build your app and test it will work
I was using Meteor with Cordova and Meteor's official google integration, which relies on cordova-plugin-googleplus.
I had to:
create both an iOS and a web Client ID
use the web Client ID on the settings / server / database as documented
but then use the reverse of the iOS web client as the REVERSED_CLIENT_ID for cordova-plugin-googleplus
Expo, authentication with Google.logInAsync from expo-google-app-auth
In my case I just used androidClientId instead of androidStandaloneAppClientId

Tencent Weibo API Web App ID

I'm trying to implement Tencent Weibo sharing on an iOS app. According to the Apple Docs you need to fill the Tencent Weibo Access Key when requesting permissions (ACTencentWeiboAppIdKeyin the options dictionary).
Can somebody guide me through the Tencent Weibo web to get an App ID for my app?
I would say that you would need to visit here to get the key, but the page just shows an empty background for me. Maybe the dev page doesn't work outside China? Can anybody over there check it out?
This answer looks relevant, but I'm not 100% sure it is talking about the same App Key.
Here's a useful step-by-step guide (in English) for registering for a API access:
http://www.cs.cmu.edu/~lingwang/weiboguide/
The process on Weibo's site is indeed in Chinese. The guide gives some guidance here.
One other suggestion would be to download the Chrome extension Zhongwen Chinese Popup Dictionary. If you don't know the meaning of a Chinese character this extension allows you to mouse over for a definition. Will help locate username, password field etc.
The step to get AppKey and AppSecret: here
The SDK about download website: here and Git URL. You can follow the example and just to change the AppKey, AppSecret, and share content.
The API document website: here
ShareSDK is also a good choice for you which have mentioned by #Allan.Chan
Maybe you can use sharesdk to do this click here

Resources