oyyq99999 / react-native-secure-storage Goto Github PK
View Code? Open in Web Editor NEWA secure AsyncStorage implementation
License: MIT License
A secure AsyncStorage implementation
License: MIT License
I did write the code which is
async function doSomething() {
const protectedData = await SInfo.getAllItems({
sharedPreferencesName: 'onSharedPrefs',
keychainService: 'onKeychain',
touchID: true,
showModal: true, //required (Android) - Will prompt user's fingerprint on Android
strings: {
// optional (Android) - You can personalize your prompt
description: 'Unlock your privatekey ',
header: 'Need Your Biometry Permission',
},
// required (iOS) - A fallback string for iOS
kSecUseOperationPrompt:
'We need your permission to retrieve encrypted data',
});
console.log('Value', protectedData);
}
but I also retrieved all key/value from getAllKeys without proving any biometrics on Android Device.
I am getting a new error (after a few months away from my project) that seems to point to react-native-secure-storage and a Gradle dependency. Here is the full error text:
Could not find com.android.tools.build:gradle:4.1.0.
Searched in the following locations:
The location it's searching in is not there, but I don't know where else to change it. I haven't had any luck with Android Studio updates helping, so I thought I would check here, as it seems to be this project that has that requirement.
I'm using your library in my project and it's fantastic! I've noticed a quirk however and I can't figure out why it's occurring. Whenever I write to the storage, touch authentication is always requested. We use touch to unlock our app and then we write to storage, so we get 2 touch id requests one after the other.
We're using it in our password manager that has an iOS extension for password autofill, and you can see the configs here and here (2 different uses of the storage).
We've tried seeing accessControl
to null
is in #6, but it still prompts us. The authenticationPrompt
property seems to have no affect on what's displayed.
Have you seen this issue before? It's really bewildering us.
Hi,
In ios devices, when I get an item from SecureStorage, it always requests Face Id to continue. I tried all config but has no difference. Does it have an option to turn off BIOMETRY?
I was not able to get this to work in iOS simulator. I'm finding that all code execution stops at...
await SecureStorage.setItem(key, str, config)
To install, I used...
npm install react-native-secure-storage --save
react-native link react-native-secure-storage
The documentation states that accessible option is only for iOS. What is the default behavior for android? Is there any possibility of being able to configure this? It's fairly critical behavior.
Android documentation says it is possible. Any chance of using this? https://developer.android.com/training/articles/keystore#UserAuthentication
Hi.
It seems like this module is not compatible with react-native-keychain
. As soon as I install and link this module in RN > 0.60, I see this error while building for iOS:
duplicate symbol '_authPolicy' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_messageForError' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_codeForError' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_rejectWithError' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_accessGroupValue' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_accessControlValue' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_accessibleValue' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
duplicate symbol '_serviceValue' in:
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNKeychain/libRNKeychain.a(RNKeychainManager.o)
/Users/sallar/Library/Developer/Xcode/DerivedData/Buttercup-aewhavlbvgapuwgsvqodosvrulab/Build/Products/Debug-iphonesimulator/RNSecureStorage/libRNSecureStorage.a(RNSecureStorage.o)
ld: 8 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thank you.
I am currently trying react-native-secure-storage and run into the following issue. On my local system everything runs fine but when running on a real device the call to setItem
fails with the error message The user name or passphrase you entered is not correct
.
My config:
const authSecureConfig = {
accessControl: ACCESS_CONTROL.BIOMETRY_ANY_OR_DEVICE_PASSCODE,
accessible: ACCESSIBLE.WHEN_UNLOCKED,
authenticationPrompt: 'continue using qroll',
service: 'qroll',
authenticateType: AUTHENTICATION_TYPE.DEVICE_PASSCODE_OR_BIOMETRICS,
};
My code that throws the error:
await SecureStorage.setItem('auth0-refresh-token', credentials.refreshToken, authSecureConfig);
I do not get any popups or any other form of dialog to enter anything. Any ideas what this could be caused by? The iPad I am testing on has no TouchId but is secured with a passcode.
Update ReadMe for Android
import li.yunqi.RNSecureStoragePackage; -> import li.yunqi.rnsecurestorage.RNSecureStoragePackage;
Seeing the following error trying to run an android build.
A problem occurred configuring project ':react-native-secure-storage'.
Could not resolve all files for configuration ':react-native-secure-storage:classpath'.
Could not find com.android.tools:common:25.3.3.
Searched in the following locations: https://jcenter.bintray.com/com/android/tools/common/25.3.3/common-25.3.3.pom https://jcenter.bintray.com/com/android/tools/common/25.3.3/common-25.3.3.jar Required by: project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools.build:manifest-merger:25.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools.ddms:ddmlib:25.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools.analytics-library:shared:25.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools.analytics-library:tracker:25.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools:sdklib:25.3.3 > com.android.tools.layoutlib:layoutlib-api:25.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools:sdklib:25.3.3 > com.android.tools:dvlib:25.3.3 project :react-native-secure-storage > com.android.tools.build:gradle:2.3.3 > com.android.tools.build:gradle-core:2.3.3 > com.android.tools.build:builder:2.3.3 > com.android.tools:sdklib:25.3.3 > com.android.tools:repository:25.3.3
While using this app on Android L (5) devices, our app crashes:
No pending exception expected: java.lang.NoSuchFieldError: no "J" field "mCtxPtr" in class "Lcom/facebook/crypto/cipher/NativeGCMCipher;" or its superclasses
I could mitigate this crash by adding this proguard rule:
-keep class com.facebook.crypto.** { *; }
I wonder, what are the correct proguard rules as it appears they are not shipped with the library?
this error occured due to upgrade project from 0.66.3 to 0.67.1
I'm getting the following error when trying to import the module.
Could not find a declaration file for module 'react-native-secure-storage'. '/Users/christopherreeves/MyKasuMobileV3/node_modules/react-native-secure-storage/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/react-native-secure-storage
if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-secure-storage';
Will this module have Typescript support?
Hi!
Can you provide the method MultiGet like 'react-native/AsyncStorage' ?
WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
REASON: Called from: ~/project/node_modules/react-native-secure-storage/android/build.gradle:97
WARNING: Debugging obsolete API calls can take time during configuration. It's recommended to not keep it on at all times.
Affected Modules: react-native-secure-storage
Hi ,
I am working with android. Does this api store data after the app in uninstalled. So that I can use the data when the app is installed next time?
Thanks!!
I am now using this component to save the user credentials after login.
In the development, I want to remove the storage and like I did with Storage component of react native, I simply removed the app from the phone and installed it again.
But it's still having the credentials in the storage.
Is there anyway to clear that ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.