How to add new Fingerprint using our own app? - android

i have Searched All over Internet about how to add new Fingerprint using our own app, but i am unable to find anything, i have also searched on stackoverflow about this and i found some Same Questions to but no one has answered about this correctly, So i have decided to ask this question one more time.
I have successfully Completed the Authentication through Fingerprint
but know i want to add multiple fingerprints to my app
I am making an app where new users Registered first they enter there name,address,emailID,Age and Fingerprint. all the data stored in MYSQLI
after that when the new user Successfully registered, when the same person tries to login, the first thing he should do is to scan his finger when the scan successfully all the Details which he mentioned while Registration will shows up
i mean his Name,addess,EmailID,Age
So, This is what i want it is similar to Bio-metric fingerprint reader but i want to do this with Mobile fingerprint scanner can anyone help me??
I have done this
Fingerprint but no success Help me out thank you

Adding a fingerprint under the direction of the app with a mobile device built-in fingerprint reader/framework is NOT POSSIBLE:
From Android Source Site:Security:Authentication:Enrollment:
On first boot of the device after a factory reset, all authenticators are prepared to receive credential enrollments from the user. A user must initially enroll a PIN/pattern/password with Gatekeeper. This initial enrollment creates a randomly generated, 64-bit User SID (user secure identifier) that serves as an identifier for the user and as a binding token for the user's cryptographic material. This User SID is cryptographically bound to the user's password; successful authentications to Gatekeeper result in AuthTokens that contain the User SID for that password.
The key part is:
A user must initially enroll a PIN/pattern/password with Gatekeeper.
That means that the owner/user must enroll a PIN which will be eventually associated with the Fingerprint.
A user who wants to change a credential must present an existing credential. If an existing credential is verified successfully, the User SID associated with the existing credential is transferred to the new credential, enabling the user to keep accessing keys after changing a credential. If a user does not present an existing credential, the new credential is enrolled with a fully random User SID. The user can access the device, but keys created under the old User SID are permanently lost. This is known as an untrusted enroll.
As you continue reading you read:
If a user does not present an existing credential, the new credential is enrolled with a fully random User SID. The user can access the device, but keys created under the old User SID are permanently lost. This is known as an untrusted enroll.
And perhaps you hope that your app can invoke an untrusted enroll
BUT
Under normal circumstances, the Android framework does not allow an untrusted enroll, so most users won't ever see this functionality. However, forcible password resets, either by a device administrator or an attacker, may cause this to occur.
So apps are only allowed to know if a user has Authenticated a preregistered Fingerprint via FingerprintManager or BiometricPrompt
What can I do
You'll have to look into external fingerprint readers to achieve what you want.
Possibly a Custom ROM would be another path to investigate, but would require a number of changes as the expectation is that each Fingerprint be cryptographically associated with PIN as well (see first quoted paragraph above).

Related

Check if credential exists without prompting for fingerprint in Android

Is there an API or other method for determining if a credential exists on the device that doesn't require taking my fingerprint first in Android?
Currently, I can call getSignPendingIntent(PublicKeyCredentialRequestOptions) with a particular credential id and then I'll be prompted to use my fingerprint. After giving my fingerprint, I'll either get an error response returned if the credential does not exist on the device or get a success response if it does exist.
Is there another method to determine if a credential exists on the device?
One reason for needing to know this is if a customer has registered a credential on device A, but then visits the website on device B. If they are on device B, I don't want to prompt them for a fingerprint to know if they can use their WebAuthN credential. I want to check if the credential exists first and otherwise fall back to the standard authentication method.
There is no way to be 100% sure. Best possible solution as of today is storing the credential id in local storage (or a cookie) where it was created. That way, you can check if you should offer fingerprint login (aka. Platform Authenticator) option on that device, i.e., in that browser.
There's been some attempts in FIDO Alliance and W3C WebAuthn WG to change this, but so far it has not been done mainly due to privacy reasons.

Firestore Phone Authentication Recovery

My future app as any other apps using firebase phone authentication may come across a situation where a user changed his phone number and/or his entire device, a new installation and a new authentication are taking place.
Given that I am enforcing writes permissions to specific documents for that specific user, how can I model a recovery procedure so that one can access and write their documents even if he changed phone number and device?
Ask the user to also add an email via user.updateEmail() to the account after they create the phone number account. This can be used to help with recovery if they change their phone. You can then trigger the password recovery flow and then on successful recovery, re-link the new phone credential to the account.

how to store fingerprint data along with username, image, email etc in database in android app

how to store fingerprint data along with username, image, email etc in database in android app. I read out many links but it is not helpful. they are
How to get Fingerprint input from user and save to sqlite in android
Retrieving Fingerprint data? Get fingerprint templates from fingerprint scanner
Register user fingerprint in an android application
Thanks
As per Nexus FAQs
Your fingerprint data is stored securely and never leaves your Pixel
or Nexus phone. Your fingerprint data isn't shared with Google or any
apps on your device. Apps are notified only whether your fingerprint
was verified.
FingeprintManager only has these 3 features:
authenticate() : for authenticating user
hasEnrolledFingerprints() : Determine if there is at least one fingerprint enrolled.
isHardwareDetected() : Determine if fingerprint hardware is present and functional.
There is no method to get fingerprint id from the sensor. So your idea of storing fingerprints in database won't work.
You cannot save a fingerprint image or template. It is stated by Android in the Fingerprint Section.
The Fingerprint data is stored by android system in the phone at a secure location which is not accessible. You can write an app that gets and stores fingerprint to authenticate the user. You can go through this sample that demonstrates to use registered fingerprints to authenticate the user in your app.
https://github.com/googlesamples/android-FingerprintDialog

how to force the user to sign in every time?

Im developing an android application for the first time (no prior experience whit coding....). Mainly the app is going to be used at work as a tool for service technicians. The app is almost ready for field testing, but there is one thing i need the app to do before that. I need the app to force the user to log in every time its opened. This is because some of the info on the app is confidential, and only people that currently works for the company is allowed to have this info. Whit firebase i can then block the users that leave the company, or users that are not verified. Currently the users sign in whit google and they stay signed in until they clear the app data or delete it.
I have looked far and wide for the answer to this, but i have only come across different use of timers.
If anyone has a better solution to this "safety" issue, im open to anything.
If you are using Google Sign-In for authentication, there is no out of the box support for forcing your user to authenticate with Google every time they use your app.
This makes sense, because the user is still authed with Google on your phone. A login system only authenticates the user; it doesn't inherently protect data stored on the device. As long as Google has a valid access token, the user won't have to type a username and password again (and simply clicking "login with Google" again doesn't really provide extra protection here).
If your primary concern is blocking access to users who have left the company, you should be covered if you are using Google Apps for your company. If you disable the user's account, their access tokens should become invalid. Google Apps admins can also manually revoke access to specific apps for specific users.
If you don't use Google Apps (e.g. your users are using #gmail.com accounts or accounts from a domain outside fo your control), you might want to consider implementing a list of users allowed to access the application, and verify the current user has access by checking that list via an API call on launch.
If the goal is really protecting the confidential information in the application, you might want to take an approach similar to Android Pay in which you require your user to set and enter a PIN number to access the application. As an added benefit, you can then use that PIN to encrypt any confidential data you are storing locally.
I will suggest you take a look into shared preferences and every time when the user is back into the app you send them to the login activity.

Limit Android to use one single fingerprint for authentication

I'm implementing fingerprint authentication in an existing Android application making use of FingerprintManagerCompat. I used a tutorial as guidance that can be found here.
(android.support.v4.content.ContextCompat)
As FingerprintManagerCompat makes use of saved fingerprints on the mobile device, any fingerprint on the device can be used to login to the application.
Is it possible to see which one of the fingerprints on the device were used to unlock and if so is there a method to get all saved fingerprints that are available on the device?
I looked around for information on if this is possible and I cant seem to find anything. I have found that Samsung Pass SDK does have functionality to see what fingerprint is used but the product owner does not want the me to use Samsung's Pass SDK as his penetration testing team found that it is not very secure.
Is there a method to get all saved fingerprints that are available on the device?
No.
Is it possible to see which one of the fingerprints on the device were used to unlock
No.
However, there are some limitations to which fingerprints can be used to authenticate within your app. The result of a fingerprint authentication is that you make a cryptographic key available to perform some cryptographic operation (e.g. creating a digital signature). So when you add a user in your app you'd typically create a cryptographic key that you associate with that user. Then later on when the user wants to perform some action that requires him/her to be authenticated, you do the fingerprint authentication, which gives you access to the key, which use can use to do whatever it is that you need to do to verify that the user should be allowed to perform the action.
What happens when a new fingerprint is enrolled is that any existing cryptographic keys that require fingerprint authentication will be permanently invalidated.
That leaves us with the scenario where there are multiple enrolled fingerprint before the user is added in your app. I'm not aware of any way to do anything about this with the current APIs. So the best you can do might be to add some step in your fingerprint-enabling UI flow where the user is asked to verify that only they have enrolled a fingerprint on the device (e.g. by checking a checkbox or clicking a button).

Categories

Resources