You need to be logged and then go to the Marketplace (you can access from your account).
Then click on "Access Keys" and you'll find yours or you will be able to create new ones.
Here's the official documentation: http://devdocs.magento.com/guides/v2.2/install-gde/prereq/connect-auth.html
You can find your authentication keys from magento connect account.
You have to first login with your magento account. If you haven't magento connect account you have to create first from link Magento Connect.
If already account then login with your username and password otherwise register your account from above link.
After Login with your account,
Go to Connect Tab (By default open with connect tab). Click on Developers button from open page.
Now you have to select secure keys from left sidebar.
You have to generate
new secure keys if already not available. Otherwise you have to
Use Public key as Username and Private key as Password
This is the authentication key for your magento.
if issue solve, Click Kudos/Accept as Solutions.
i tried to get magento connect key but the marketplace page is coming up with the timeout error ever time. is there any other way to get the key