i'm using cordova-plugin-googleplus for authentication with google accounts in my Ionic app.
I've done all the steps listed in docs, but it stills doesn't working. I've got the diabolic 12501 error.
I have the credentials and i'm calling the authentication method using:
vm.loginWithGoogle = () => {
console.log('Login with google', window.plugins.googleplus);
window.plugins.googleplus.login(
{webClientId:'my-credentials'},
success => console.log('success', success),
error => console.log('error', error)
);
}
Somebody passed through this before?
just now i'm facing this issue. solved by
on "ionic plugin add", reverse your key you got from google console
sign your app with key generated from keytool that you used for google console
regards,
Related
When using firebase auth emulator, the console where firebase emulators:start is running, will output a link to emulate sign in.
My app is being built in Flutter. The following code creates the sign in link that is output in the emulator console.
final ActionCodeSettings acs = ActionCodeSettings(
url: 'https://example.com',
dynamicLinkDomain: 'mydomain.page.link',
handleCodeInApp: true,
iOSBundleId: kIosBundledId,
androidPackageName: kAndroidPackageName,
androidInstallApp: true,
androidMinimumVersion: '24',
);
await _firebaseAuth
.sendSignInLinkToEmail(
email: email,
actionCodeSettings: acs,
)
.catchError((onError) {
throw AuthException('Error sending email verification $onError');
}).then((value) {
debugPrint('Successfully sent email verification.');
});
Code above outputs links like the following where the action?mode=signIn:
http://localhost:9099/emulator/action?mode=signIn&lang=en&oobCode=lkjlkjklj&apiKey=fake-api-key&continueUrl=https%3A%2F%2Fmydomain.page.link%2FezHe
Pasting the link into my browser where the auth emulator is running at http://localhost:9099 I'm expecting to see something like this.
{
"authEmulator": {
"success": "The email has been successfully verified and you are signed in.",
"email": "customer#example.com"
}
}
Rather than the expected "success..." output, the continueUrl link, which is the short url configured in my Dynamic Links, is called and this short url then redirects to the configured deep link url for the dynamic link, which lands me on my desktop website. No auth emulator results are displayed.
If I remove the continueUrl parameter I can see the auth emulator output like below, so I know the auth emulator is evaluating the sign in as link. I can't find any docs on how to trigger the auth emulator for passwordless sign in auth testing.
{
"authEmulator": {
"error": "Missing continueUrl query parameter",
"instructions": "To sign in, append &continueUrl=YOUR_APP_URL to the link."
}
}
Am I missing an auth emulator parameter that should be part of the url to trigger passwordless sign in as auth?
I am working on an action on google using Actions SDK, however when i enabled the Actions; verification as described at:
https://developers.google.com/actions/reference/rest/verify-requests
I am getting the below error, this only comes when i am behind corporate proxy, can anyone suggest a solution for this?
{
"error": "ID token verification failed: Error: Failed to retrieve verification certificates: Error: write EPROTO 139904972138304:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:825:\n\n at OAuth2Client. (/opt/app/node_modules/actions-on-google/node_modules/google-auth-library/build/src/auth/oauth2client.js:580:31)\n at step (/opt/app/node_modules/actions-on-google/node_modules/google-auth-library/build/src/auth/oauth2client.js:57:23)\n at Object.throw (/opt/app/node_modules/actions-on-google/node_modules/google-auth-library/build/src/auth/oauth2client.js:38:53)\n at rejected (/opt/app/node_modules/actions-on-google/node_modules/google-auth-library/build/src/auth/oauth2client.js:30:65)\n at propagateAslWrapper (/opt/.npm-global/lib/node_modules/ca-apm-probe/node_modules/async-listener/index.js:502:23)\n at /opt/.npm-global/lib/node_modules/ca-apm-probe/node_modules/async-listener/glue.js:188:31\n at /opt/.npm-global/lib/node_modules/ca-apm-probe/node_modules/async-listener/index.js:539:70\n at /opt/.npm-global/lib/node_modules/ca-apm-probe/node_modules/async-listener/glue.js:188:31\n at :null:null\n"
}
I am using v2.5.0 of actions-on-google
So i was able to sort this issue, the underlying issue is with axios library being used by google auth library (v1.3.2)
here is the issue : https://github.com/axios/axios/issues/662
The workaround for me was to replace axios with request promise in google auth library and then publish it in our private npm registry, this solved the issue for now.
I have tried the firebase email authentication with an ionic 2 app. The authentication is working in the browser with 'ionic serve' but not on the device.
I can create new users and login in the browser and nothing is working on the device.
I have an auth-data provider with the following function:
loginUser(email: string, password: string): any {
return this.fireAuth.signInWithEmailAndPassword(email, password);
}
And calling this function from login.ts
loginUser() {
//Call to AuthData service to login the user
this.authData.loginUser(this.loginForm.value.email, this.loginForm.value.password).then( authData => {
//User is authenticated and navigates to homePage
this.nav.setRoot(HomePage);
})
}
I'm getting this alert on device:
"A network error (such as timeout, interrupted connection or unreachable host) has occurred."
Any idea on what's going on?
Please install cordova whitelist plugin by
cordova plugin add cordova-plugin-whitelist
and add the following line to src/config.xml
<allow-intent href="https://*.firebaseio.com"/>
I'm trying to get started with Azure Mobile Services and Visual Studio Tools for Apache Cordova. (https://msdn.microsoft.com/en-gb/magazine/dn879353.aspx)
I want to use the Mobile Service for push notifications. I've created the service, with a Node backend, and a TodoItem table. I've got a GCM set up too.
However, when trying to register a template, I get a 404 Not Found error:
var GCM_SENDER_ID = 'MY_GCM_ID';
mobileServiceClient = new WindowsAzure.MobileServiceClient(
"MY_URL",
"MY_API_KEY"
);
pushNotification = PushNotification.init({
"android": { "senderID": GCM_SENDER_ID }
});
pushNotification.on('registration', function (data) {
var handle = data.registrationId; //This appears to be set alright
var platform = device.platform; // This is 'Android'
if (platform == 'android' || platform == 'Android') {
var template = '{ "data" : {"message":"$(message)"}}';
mobileServiceClient.push.gcm.registerTemplate(handle, 'myTemplate', template, null);
});
The final line gives me a 404. I'm running the app in the Google Android Emulator.
EDIT: I tried calling the registrations endpoint using Postman: https://myservice.azure-mobile.net/push/registrations?platform=gcm&deviceId=
If I do a GET, I get [] as a response, if I do a POST, I get 404
Finally fixed it - I didn't have the Cordova Whitelist Plugin installed!
I realised after debugging into MobileServices.Web.js and seeing that the exact same request that was successful with Postman was failing in the Android Emulator.
Have setup a project at Google Code APis console and have a server key at "Key for server apps (with IP locking)". I'am trying to send a push notification to GCM device using "API key" and one registration ID that I have stored at database.
For server side I'am using Zend_Mobile_Push_Gcm and have something like this:
$token = 'REGISTRATION ID';
$apiKey = 'API KEY';
//Send test push
$message = new Zend_Mobile_Push_Message_Gcm();
$message->setId(time());
$message->addToken($token);
$message->setData(array('foo' => 'bar', 'bar'=>'foo'));
$gcm = new Zend_Mobile_Push_Gcm();
$gcm->setApiKey($apiKey);
try {
$response = $gcm->send($message);
} catch (Zend_Mobile_Push_Exception $e) {
die($e->getMessage());
}
On the app side, I have used the GCM demo, that is currently registering it's registration ID on a server service.
I'am not able to send the push, always get a 401 error. Have gone through troubleshooting and tried my API KEY and Registration ID with the CLI test line at http://developer.android.com/guide/google/gcm/gcm.html#auth_error but with no success.
Any help would be appreciated.
I realise this was posted a while ago but be sure to use your server API key and not your android API key.
I had the same issue when trying to use my Android API key from PHP with Zend.