After I succeeded to make 'platform' credential, I tried to retrieve the credential to get the assertion.
but when I passed the credentialRequestOptions as below
const publicKeyCredentialRequestOptions = {
challenge: Uint8Array.from(challengeFromServer, (c) => c.charCodeAt(0)),
allowCredentials: [
{
transports: ["internal"],
type: "public-key",
id: Uint8Array.from(credentialId, (c) => c.charCodeAt(0))
}
],
timeout: 60000,
userVerification: "required",
rpId: rpId
}
the userVerification pop-up, finger-print verification, appeared as normal
but after I fulfilled it, I got "The operation either timed out or was not allowed" exception.
when I remove the tansports: ["internal"] option in allowCredential, my device asked me "choose the secure key from BlueTooth, NFC or USB"
it seems my device does not support 'internal' credential.
Testing Env
Device : SM-N971N(Galaxy Note10)
OS : Android12
Browser : Chrome 107.0.5304.91
The most likely cause is that the credential ID is incorrect. Try logging it with console.log() immediately after registration, and immediately before making the assertion to ensure that there's no an encoding issue.
Related
When a user signs up, I am requiring them to verify their email address.
It works fine in Firefox and Chrome, but not in Safari, where I get the following message:
Error: A network error (such as timeout, interrupted connection or unreachable host) has occurred.
And no confirmation email is sent.
I’m sourcing this version:
firebasejs/6.4.0/firebase-auth.js
I've searched for similar problems. There were lots of Firebase Authentication errors, but I didn't find this one.
Using the Safari JavaScript debugger, filtering for all exceptions I receive the errors below.
And interestingly, after stepping through with the debugger on, setting Breakpoints at "All Exceptions" an email is sent. But not when running in real-time.
Hopefully that is a clue.
I send the email verification with this code.
if (current_user && !current_user.emailVerified) {
current_user.sendEmailVerification().then(function() {
const user_message = '<message to user>';
window.location = '/message?message=' + user_message;
}).catch((error) => {
console.log(error);
} );
}
The errors:
line 515 rpchandler.js
try {
response = JSON.parse(this.getResponseText()) || null;
It looks like the response is null.
line 183 promise.js Exception with thrown value: zi
try {
// Promise was rejected. Step up one call frame to see why.
if (reason instanceof Error) {
throw reason;
This happens a few times.
line 2190 authuser.js
// Cache the invalidation error.
self.userInvalidatedError_ = /** #type {!fireauth.AuthError} */ (error);
line 740 firebase-app.js
Exception with thrown value: TypeError: Argument to String.prototype.startsWith cannot be a RegExp
Any ideas?
I ended up rolling my own email verification workflow.
I'd be interested in reverting back to the Firebase Auth JavaScript email verification workflow, if there is a solution. But for now, I just have to move forward.
I'm trying to connect to a Microchip "RN4678" dual mode bluetooth device from my Windows 10 machine using BLE with the web bluetooth api. I can find the device -> the service -> the characteristic I need but I keep getting a "GATT Error: Not paired." when trying to start notifications on the characteristic.
My JavaScript experience is minimal, so I thought that I may have been chaining my promises wrong, however printing out the device info directly before trying to add the characteristic shows the value for "connected" as true.
I have also verified that the device, service, and characteristic work as intended with the "nRF Connect" app on my android device.
Here is my code:
let targetService = '49535343-fe7d-4ae5-8fa9-9fafd205e455';
let txCharacteristicId = '49535343-1e4d-4bd9-ba61-23c647249616';
let rxCharacteristicId = '49535343-8841-43f4-a8d4-ecbe34729bb3';
function onButtonClick(event) {
// Find bluetooth device
console.log('Requesting Bluetooth Device...');
navigator.bluetooth.requestDevice({
acceptAllDevices: true,
optionalServices: [targetService]
})
// Connect to device
.then(device => device.gatt.connect())
// Get the server we want
.then(server => {
console.log('Getting UART transparent service...');
return server.getPrimaryService(targetService);
})
// Handle the characteristics we need
.then(service => {
return service.getCharacteristic(txCharacteristicId)
})
.then(characteristic => {
console.dir(characteristic.service.device);
return characteristic.startNotifications();
})
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged',
handleTx);
})
.catch(error => {
console.log(error);
console.log(error.code);
console.log(error.message);
console.log(error.name);
});
}
function handleTx(event) {
console.log(event.target.value);
}
And here are the console messages I get:
index.html:18 Requesting Bluetooth Device...
index.html:27 Getting UART transparent service...
index.html:35 BluetoothDevice
gatt: BluetoothRemoteGATTServer
connected: true
device: BluetoothDevice {id: "p+lJYscejR+Xl4eX+VbNkA==", name: "Dual-SPP", gatt: BluetoothRemoteGATTServer, ongattserverdisconnected: null}
__proto__: BluetoothRemoteGATTServer
id: "p+lJYscejR+Xl4eX+VbNkA=="
name: "Dual-SPP"
ongattserverdisconnected: null
__proto__: BluetoothDevice
index.html:44 DOMException
index.html:45 19
index.html:46 GATT Error: Not paired.
index.html:47 NetworkError
Here is the documentation for the web bluetooth startNotifications() function (https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-startnotifications):
The startNotifications() method, when invoked, MUST return a new
promise promise and run the following steps in parallel. See §5.6.4
Responding to Notifications and Indications for details of receiving
notifications.
If this.uuid is blocklisted for reads, reject promise with a SecurityError and abort these steps.
If this.service.device.gatt.connected is false, reject promise with a NetworkError and abort these steps.
Let characteristic be this.[[representedCharacteristic]].
If characteristic is null, return a promise rejected with an InvalidStateError and abort these steps.
If neither of the Notify or Indicate bits are set in characteristic’s properties, reject promise with a NotSupportedError
and abort these steps.
If characteristic’s active notification context set contains navigator.bluetooth, resolve promise with this and abort these steps.
If the UA is currently using the Bluetooth system, it MAY reject promise with a NetworkError and abort these steps. ISSUE 9:
Implementations may be able to avoid this NetworkError, but for now
sites need to serialize their use of this API and/or give the user a
way to retry failed operations.
https://github.com/WebBluetoothCG/web-bluetooth/issues/188
If the characteristic has a Client Characteristic Configuration descriptor, use any of the Characteristic Descriptors procedures to
ensure that one of the Notification or Indication bits in
characteristic’s Client Characteristic Configuration descriptor is
set, matching the constraints in characteristic’s properties. The UA
SHOULD avoid setting both bits, and MUST deduplicate value-change
events if both bits are set. Handle errors as described in §5.7 Error
handling. Note: Some devices have characteristics whose properties
include the Notify or Indicate bit but that don’t have a Client
Characteristic Configuration descriptor. These non-standard-compliant
characteristics tend to send notifications or indications
unconditionally, so this specification allows applications to simply
subscribe to their messages.
If the previous step returned an error, reject promise with that error and abort these steps.
Add navigator.bluetooth to characteristic’s active notification context set.
Resolve promise with this. After notifications are enabled, the resulting value-change events won’t be delivered until after the
current microtask checkpoint. This allows a developer to set up
handlers in the .then handler of the result promise.
Edit:
I'm using Chrome version 74, Windows 10.0.17134
I found the solution for my device, I hope it works for you as well. As it turns out, the device must be paired with Windows OS prior to establishing a connection via Web Bluetooth. So even though Web Bluetooth would "connect" and display all GATT properties - the device was actually disconnecting when it receives the startNotifications() command (since it is not paired through the OS). Additionally, (in my case, but this is probably device specific) my "default passcode" was 000000 (needed to be exactly 6 zeros). Be sure to double check that when pairing with Windows OS.
Edit: This behavior (having to pair the device with the OS, prior to establishing a Web Bluetooth connection) is a bug that has been discovered on macOS in addition to Windows. See this chrome-bug for more information.
Edit: I'm changing the question to suit my current understanding of the problem which has changed significantly.
Original Title: Nodegit seems to be asking for wrong credentials on push
When trying to push using nodegit nothing seems to work on Windows (while they work fine on Linux).
Using SSH
sshKeyFromAgent - error authenticating: failed connecting agent
sshKeyNew - credentials callback is repeatedly (looks like an infinite loop
but I can't be sure)
sshKeyMemoryNew: credentials is called twice and then node exits with no diagnostic (the exit and beforeExit events on process aren't signalled)
Using HTTPS
userpassPlaintextNew: [Error: unknown certificate check failure] errno: -17
Original question follows.
I'm trying to get nodegit to push and the following question seems to address this situation. However I'm not able to get it to work.
I've cloned a repository using SSH and when I try to push, my credentials callback is being called with user git and not motti (which is the actual git user).
try {
const remote = await repository.getRemote("origin");
await remote.push(["refs/head/master:refs/heads/master"], {
callbacks: {
credentials: (url, user) => {
console.log(`Push asked for credentials for '${user}' on ${url}`);
return git.Cred.sshKeyFromAgent(user);
}
}
});
}
catch(err) {
console.log("Error:", err);
}
I get the following output:
Push asked for credentials for 'git' on git#github.[redacted].net:motti/tmp.git
Error: { Error: error authenticating: failed connecting agent errno: -1, errorFunction: 'Remote.push' }
If I try to hardcode motti to the sshKeyFromAgent function the error changes to:
Error: { Error: username does not match previous request errno: -1, errorFunction: 'Remote.push' }
This my first time trying to programmatically use git so I may be missing something basic...
Answer for some questions from comments:
I'm running on windows 10
node v8.9.4
git version 2.15.0.windows.1
nodegit version 0.24.1
the user running node is my primary user which when I use for git in command line works correctly
Instead of using git.Cred.sshKeyFromAgent - you could use git.Cred.sshKeyNew and pass your username / keys along.
const fs = require('fs');
// ...
const username = "git";
const publickey = fs.readFileSync("PATH TO PUBLIC KEY").toString();
const privatekey = fs.readFileSync("PATH TO PRIVATE KEY").toString();
const passphrase = "YOUR PASSPHRASE IF THE KEY HAS ONE";
const cred = await Git.Cred.sshKeyMemoryNew(username, publickey, privatekey, passphrase);
const remote = await repository.getRemote("origin");
await remote.push(["refs/head/master:refs/heads/master"], {
callbacks: {
credentials: (url, user) => cred
}
});
You need to run an ssh agent locally and save your password there. Follow these steps to make it work:
Enable the ssh agent locally (automatically runs on OS X): https://code.visualstudio.com/docs/remote/troubleshooting#_setting-up-the-ssh-agent
Run 'ssh-add' in the same CLI as you're running your nodegit actions and enter your passphrase
I hope this helps because I also struggled a lot with it and it can be very frustrating.
im currently doing the quick-start of domino-db and when i tried to create a document i got an internal error with the error message "bulkNote request failed with Proton code 65561".
Do you know what the problem is and is it possible to check some logs of proton to see what went wrong.
const serverConfig = {
hostName : 'XXXXXXX.de', // Host name of and port are valid
connection: {
port: 'XXXX',
},
};
const databaseConfig = {
filePath: 'node-demo.nsf', // The database file name
};
useServer(serverConfig)
.then((server) => server.useDatabase(databaseConfig))
.then((database) => database.createDocument({
document: {
Form: 'Contact',
FirstName: 'Aaron',
LastName: 'Aardman',
City: 'Arlington',
State: 'MA',
},
}))
.catch(console.error);
edit:
The error appears every time i access a document(document.read, bulkReadDocuments) not only by the creation of a document.
Here's the definition of that error code (from errorcodes.js):
65561: { id: 'INVALID_SQN', msg: 'Invalid or missing protocol sequence number.' },
This suggests you are using the Beta version of domino-db with the latest release of Proton. Proton now checks the protocol sequence number for every request -- to make sure it's not an incompatible request from a newer client. The Beta version of domino-db did not send the sequence number.
Please check your app and make sure it's using the latest version of domino-db.
I get this error in staging but not in development when the browser tries to connect to my mosquitto server in Firefox:
SecurityError: The operation is insecure.
I'm not running the system with ssl and I know I should fix this but for the time been I would like to make this work.
function mqtt() {
// Create a client instance
client = new Paho.MQTT.Client('localhost', 9091, "", "tablet_1");
// set callback handlers
client.onConnectionLost = onConnectionLost;
client.onMessageArrived = onMessageArrived;
client.reconnect = true
willMessage = new Paho.MQTT.Message("Rescue me");
connectOptions = {
userName: 'server',
password: '1234',
// willMessage: willMessage,
onSuccess:onConnect,
cleanSession: true,
reconnect: true,
useSSL: false
}
// connect the client
client.connect(connectOptions);
}
This are my port configurations in mosquitto:
listener 1883
listener 8883
cafile ca.crt
certfile server.crt
keyfile server.key
tls_version tlsv1.2
listener 9091
protocol websockets
As hashed out in the comments, this is the browser blocking none secure content when the host page is loaded over https.
You can force mixed content by clicking on the shield in the URL bar, but this is not the right approach.
The correct solution to this is to run HTTPS/TLS everywhere (even in dev/staging).