Autofilling new password with confirmation in iOS 12 - uikit

I've added 3 UITextFields to create a new account by entering a username in email address format, a new password and a password confirmation. As suggested in Enabling Password AutoFill on a Text Input View. I have configured the username field like this
userTextField.textContentType = .username
userTextField.keyboardType = .emailAddress
and the new password fields like this
newPasswordTextField.textContentType = .newPassword
confirmPasswordTextField.textContentType = .newPassword
Now, when the users enters an email address as username the newPasswordTextField is pre-filled with a suggestion for a strong password (as expected), but the confirmPasswordTextField isn't filled with the same suggested password.
When the user directly taps into the newPasswordTextField without entering a username before both newPasswordTextField and confirmPasswordTextField are pre-filled with the same suggested password (also as suggested).
How can i combine this both situations that after the user enters a username both password fields will be pre-filled with the same password?

I was able to do autocomplete for 2 password fields by declaring the contentType of the first field as: .password
.username
.password
.newPassword

iOS 14 update
The answer from cornr worked for iOS 12 and 13.
However, it fails since iOS 14 in our app, as it will now request access to Keychain to auto-fill the stored password.
It seems that per iOS 14 Apple made it finally match their docu example to create a new account or changing the password. This means that for both password fields .newPassword should be used.
Having that said, suggesting a strong password fails entirely for us on iOS 14.2. For more details see this post.

Related

Windows credential provider pinlogonprovider

I am trying to make a Windows custom credential provider using this reference https://learn.microsoft.com/en-us/samples/microsoft/windows-classic-samples/credential-provider/
https://www.microsoft.com/en-us/download/details.aspx?id=53556#:~:text=Credential%20providers%20are%20used%20in,for%20Windows%20Vista%20and%20higher
The idea is:
I kept the username and password inside the pc
I use my own MFA (just simple push notification to my android phone)
If I confirm the notification, I will use the stored username & password to login
It works well whenever I match the password and Username, and login using my "Credential Provider"
Then I realize, after I login to my Microsoft username, The next login will be prompted PIN instead of password like this:
I know I can keep my Microsoft account's Password to my offline database and my idea is still working.
However, since my password is too long, I want to keep the pin instead of the password
Does Windows credential provider support PIN authentication?
I tried to google it, and it just showing the smartcard's pin instead of the Windows Logon Pin
------------------- UPDATE ------------
Looks like I did not write the question clearly
I want to extend my current Credential Provider that able to automatically sign in using password and Windows Hello PIN.
So the Database will consist of username and PIN (that match with Windows Hello PIN) or Password (that match with Local account password)
Is it possible?
Have a look how you set-up new logon using Picture or PIN credential providers from Microsoft Hello - initially you enter your password.
So these providers store this collected data in some internals and later provide them as collected by themself.
Nobody restrict you from doing the same way.
------------------- UPDATE ------------
Have a look at SampleWrapExistingCredentialProvider

How to store password in a field using openerp

In my database 15 users are have their login and password. If any user change their password then we don't know the users current password. I want to save the password of each users that admin have the only permission to view.If any user changed their password, then admin can know their password, because if we want to login with particular user then it results wrong password.
or
when I login to odoo there is no option to save the password, the username is restore but I want to keep the password automatically fill in the field, does anybody know how to do it?
Thanks........
It's not a good idea to save a password unencrypted in your database.
I'd suggest to take a look at the auth_admin_passkey module.
This would give you the possibility to login at all useraccounts with the admin password.
If you really want to save the new password you could override the write method from res.users and check for the field "password". this way you could save the password to your desired field before it gets encrypted.

Error Testing My Data on api.parse.com Using Their Keys

I am new to Parse.com and am trying to test the data I have created on their platform but it is not going through. I have followed the book am reading and it's time to test the data I have created on Parse but it's not working.
I am supposed to type the following address into the browser and receive all the data I have created under the "Products" class as JSON in the browser. I am doing it to test it if it is working.
https://<appID>:javascript-keys=<jsKEY>#api.parse.com/1/classes/Products
appID is replaced with my Parse-applicationID and jsKEY is replaced with my Parse-JavascriptKEY. When I enter the above address into the browser, a dialog box appears asking me to enter my username and password. I typed my www.Parse.com username and password but its not working.
First, I receive a confirmation box with the following message:
You are about to log in to the site "api.parse.com" with the username "<appID>".
appID is the application ID from parse.com
I will click OK and then I receive a prompt dialog box with two input fields for username and password. I enter my parse.com username and password but then it does not work. I also try to use the <appID> as the username and with the parse.com password but still it does not work.
The dialog box means that the authentication failed, so they ask for your username and your password again. The URL scheme is https://user:password#api.parse.com/1/classes/Products. So when the dialog ask for your username and password it actually ask for your appID as username, and your jsKey (with the string "javascript-key=" in front of it) as password.
The issue here is that you are adding a s at the end of key in the string javascript-key=.

Forgot Password Logic in codeigniter

can someone please explain me the logic of forgot password procedure i.e how can I implement a forgot password logic while using codeigniter framework.
For forgot password, first take user id i.e. User email for authorizing him i.e. search in your database where any user exist of such email...
Now after authorizing, generate random password and at the same time update that database entry with random password and send that random password to the user via Email....
After user login with that user ask user to update his/her password

Best workflow for binding website user accounts with facebook accounts

I need to implement facebook-connect to a website where users already might have their internal accounts. If internal account doesn't exist, it should be created from facebook credentials. Also it should be possible to link an existing account to facebook account. The technical implementation is clear to me, but I am more interested about a practical, optimal, and understandable user activity workflow.
1) My initial idea was to have a login form with user and password fields and two buttons: "connect with facebook" and "login". If "login" is pressed, the internal account is normally logged in. If "connect with facebook" is pressed, the user is connected to facebook and then depending on the state of user and password, I could retrieve the internal user and bind it with facebook user, or create a new internal user and bind it to facebook user, or retrieve the internal user that is binded to the facebook user. However, there I see some gotchas in the workflow. What if the user and password entered are of a different internal user than the one that is binded to the facebook account?
I will try to illustrate the problem in pseudocode:
if "login" is pressed:
internal_user = authenticate(username, password)
if "connect to facebook" is pressed:
facebook_user = get_facebook_user()
if username and password are filled in:
internal_user = authenticate(username, password)
if facebook_user has no internal_user:
facebook_user.bind_internal_user(internal_user)
else:
# conflict! what to do with it?
# facebook_user.get_internal_user() != internal_user
else:
if facebook_user has internal_user:
internal_user = facebook_user.get_internal_user()
else:
internal_user = facebook_user.create_internal_user()
internal_user.login()
Also users might get confused asking themselves if they need to enter facebook username and password or the username and password of the website.
2) Another option could be to have a login form, connect to facebook, and registration form as three different options, where connect to facebook would either get or create an internal account; and then a separate optional form for logged-in users to bind their facebook accounts. But then again there would be possibilites left to create a duplicate internal account.
What are the best practices to deal with that? What are the other websites using mostly?
Login form:
[username] |
[password] | or [fbconnect button] with facebook
[ok] |
(two mutually exclusive sections "either or", you don't need to fill out the login form if you use facebook)
Once a user is connected with FB and you don't have associated user account for this uid then you popup another form:
Welcome,
Please choose username for this site:
[username] [ok]
(you can prompt to select a password as well if you want)
----------------------------------------------------
If you already have an account on our site please enter your credentials:
[username]
[password]
[ok]
After this step you should be covered - no matter which way they chose the result should be the same.
Usually you don't prompt for password for facebook connected users during login, they just use facebook connect button, so randomly generated password would do. If you want to create full scale account that could be used without facebook then you prompt for a password (but still don't use it for facebook login).
FBConnect should ignore your username/pass, in your database you need to store the fb tokens which will be returned from a fb connect login. If the user successfully logs in you will be redirected to a page of your choosing where you can take that fb token and compare it to the database and ignore the username/password. The username/password they filled in on the form will be ignored when fb pops up its own login window.
I hope that answers your question.

Resources