Comments (20)
Can you give me a few more details? iOS, Android? Versions?
from cordova-plugin-secure-storage.
Also it's actually cordova.plugins.SecureStorage not SecureStorage. Is this it?
from cordova-plugin-secure-storage.
Hi Sorry, Android running on 5.0. I tried var ss = new cordova.plugins.SecureStorage(
It called that error saying cordova.plugins.SecureStorage isnt a function, so i tried the
var ss = new SecureStorage(
But it also called the same error.
from cordova-plugin-secure-storage.
Could you please try with an empty app and describe the steps you follow?
I made a new app, run
cordova plugin add cordova-plugin-secure-storage
and can see the constructor fine.
from cordova-plugin-secure-storage.
Hiii
I think i might have got it working, but it asked me to set my screen lock?? And i have to have a screen lock on for it to work??
from cordova-plugin-secure-storage.
Could you please let us know what was the problem?
You do indeed need to have screen lock to access certain parts of the crypto API.
from cordova-plugin-secure-storage.
Hi thanks, the first problem was my mistake i was pulling from a wrong fork.
But when i fixed that up, the second problem was with the id,because i am using phonegap build. The reference had to be changed. So i just renamed the id to com.secure.plugins.crypho, but because the securestorage.js is referencing the sjcl_ss, so i also had to change the first line of the sjcl_ss to var sjcl_ss = cordova.require('com.secure.plugins.crypho.sjcl_ss'); So it is referencing it correctly.
Then it worked.
So a quick question, if i just want to put some encrypted data into secure storage for Android/IOS, would i also need the screen lock to be on?? the ss.set/ss.get for example?
Sorry i didnt understand before how this work, so basically for android the user sets a screen lock pin to the native device and that pin is used to encrypt with the AES right? thats why the screen lock pin is needed?
from cordova-plugin-secure-storage.
You shouldn't have to do any of that. Would you please try again by:
cordova create test
cd test
cordova plugin add cordova-plugin-secure-storage
cordova platform add android
Then try using the storage.
To your second question:
Yes, in order to use the RSA storage built in with android, you need to have some sort of locking on the phone. The minimum is a PIN password.
from cordova-plugin-secure-storage.
I also encountered the same problem:『TypeError: Cannot read property 'SecureStorage' of undefined
』
Js files are loaded in.
code:
return new cordova.plugins.SecureStorage(
function () { console.log('Success') },
function (error) { console.error('Error ' + error); },
name);
from cordova-plugin-secure-storage.
Perhaps you guys could help debug this? I am not seeing this in a clean installation. Is this android also?
Could you try to debug and figure out what happens?
from cordova-plugin-secure-storage.
Hey guys
I had that problem before but i have resolved that. @mysoko did you install it thru cordova or Phonegap?
I had that problem when i packaged it and installed through phonegap, the core reason for me was the file directory name. I just renamed the file; as it was calling SecureStorage of undefined, it isn't seeing that file i assumed.
Have a look if that solve your problem.
from cordova-plugin-secure-storage.
@clarklight can you please elaborate a bit? What file directory?
from cordova-plugin-secure-storage.
Also @mysoko are you also on phonegap? We've only tested with crodova, perhaps there are some quirks we need to figure out on phonegap.
from cordova-plugin-secure-storage.
crodova 5.4.0, cordova android 5.0.0
from cordova-plugin-secure-storage.
Probably locate the problem, load order problem js of, cordova js plugin loader is asynchronous, so not every get cordova.plugins.SecureStorage
from cordova-plugin-secure-storage.
@mysoko From the trace looks like you try to instantiate the SecureStorage before having received the deviceready event,
Just tested on Cordova 5.4.1 fresh project (android, browser platforms) the following code and did not experience any exceptions
var app = {
// Application Constructor
initialize: function() {
this.bindEvents();
},
// Bind Event Listeners
//
// Bind any events that are required on startup. Common events are:
// 'load', 'deviceready', 'offline', and 'online'.
bindEvents: function() {
document.addEventListener('deviceready', this.onDeviceReady, false);
},
// deviceready Event Handler
//
// The scope of 'this' is the event. In order to call the 'receivedEvent'
// function, we must explicitly call 'app.receivedEvent(...);'
onDeviceReady: function() {
app.receivedEvent('deviceready');
var ss = new cordova.plugins.SecureStorage(
function () { console.log('Success') },
function (error) { console.error('Error ' + error); },
name);
},
// Update DOM on a Received Event
receivedEvent: function(id) {
var parentElement = document.getElementById(id);
var listeningElement = parentElement.querySelector('.listening');
var receivedElement = parentElement.querySelector('.received');
listeningElement.setAttribute('style', 'display:none;');
receivedElement.setAttribute('style', 'display:block;');
console.log('Received Event: ' + id);
}
};
app.initialize();
from cordova-plugin-secure-storage.
@mysoko Also note that at least on Android the plugin is usable only after the success method has been called
from cordova-plugin-secure-storage.
@mysoko @clarklight can you confirm what @demetris-manikas suggests solves your problem?
from cordova-plugin-secure-storage.
Loading problem, put onDeviceReady's ok.
Because the angular and ui-router route I use, will first perform homeCtrl so it did not get any information.
We made the following changes:
angular.config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
//$urlRouterProvider.otherwise("/");
to:
onDeviceReady: function() {
location.hash = '/';
}
First contact cordova encountered many problems, thank you for help.
from cordova-plugin-secure-storage.
Closing this, @clarklight if it still persists, let me know and I will open it. Added an FAQ section on the README with explicit instructions.
from cordova-plugin-secure-storage.
Related Issues (20)
- Where can I inspect the saved passwords on my iOS device? HOT 4
- Exception on Android Pie HOT 7
- Where is sjcl_ss.js? HOT 4
- Dependency on SAMKeychain HOT 3
- uncaught exception error HOT 3
- Do not rely on internal Android API for screen unlock HOT 11
- Usage of OAEP HOT 1
- Link doesn't work in readme HOT 1
- Exception on Android Pie after adding back lock screen HOT 15
- Save value of ss.get() in a variable ? HOT 1
- Android Q API 28 ERROR: No Activity found to handle Intent { act=com.android.credentials.UNLOCK } HOT 32
- iOS User interaction is not allowed HOT 1
- Data is still accessible after loging out of icloud HOT 1
- icloud
- App using unlockCredentials crash on Android Q HOT 2
- Refactor actions in static class so it can be re-used by other plugins HOT 1
- How to check whether key exist or not HOT 1
- android.content.ActivityNotFoundException HOT 2
- Capacitor support HOT 1
- Still having a problem with this. Running emulator on 12.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-plugin-secure-storage.