Autofill security codes from your iPhone in Safari on Mac
You can use the security codes sent to your iPhone (iOS 8.1 or later) to automatically sign in to web pages on your Mac.
Set up Text Message Forwarding on your iPhone
On your iPhone, go to Settings > Messages > Text Message Forwarding.
Tap your Mac.
Autofill security codes on your Mac
In the Safari app on your Mac, sign in to a web page that typically sends a security code to your iPhone.
When you’re prompted to enter the security code, Safari provides the information on your Mac.
Click the security code (or use the Touch Bar).