Skip to main content

TaxScout: Connecting a Government Gateway Login with 2FA

If your Government Gateway login uses two-factor authentication, here's how to add the secret key so Socket can sync automatically.

Written by Simon Evans

When you add a Government Gateway login to TaxScout, you have the option to include a 2FA setup code. This allows Socket to generate the correct authentication codes automatically each time it syncs with HMRC, so you don't need to manually enter a code on every sync.

This only applies if your Government Gateway agent login has two-factor authentication enabled.

Before you start

You'll need your Government Gateway User ID, password, and the secret key from your HMRC authenticator app setup screen. The secret key is the long string of characters shown in the box below the QR code. It is not the 6-digit rotating code your authenticator app displays.

If you haven't set up 2FA on your Government Gateway account yet, do that first via the HMRC agent services portal, then come back to this step.

Recommended: set up a dedicated sub-user for Socket

Rather than connecting TaxScout using your main admin Government Gateway credentials, we recommend creating a dedicated sub-user on your HMRC agent account and using those credentials instead. This is better for security and means your TaxScout connection won't be affected if your main admin user changes their password or 2FA setup.

To add a sub-user to your HMRC online services for agents account:

  1. Select Your account from the main menu.

  2. Select Add or delete team members under the Manage your team heading.

  3. Add a new standard user and assign the relevant tax types this user needs access to.

  4. Once created, use that sub-user's credentials when adding your Government Gateway login in TaxScout.

Full guidance on setting up sub-users is available on GOV.UK.

Step 1: Find your secret key in Government Gateway

Log in to your HMRC Government Gateway agent account and go to your security settings. Find the authenticator app setup screen. This shows a QR code and a long secret key in a box below it. Copy the secret key.

Step 2: Open TaxScout Settings

In Socket, navigate to TaxScout using the left-hand menu. Click Settings in the top right corner of the TaxScout screen. Under HMRC Connections, click Add Government Gateway Login.

If this is your first time connecting, you'll see a Connect Government Gateway button on the TaxScout overview page.

Step 3: Fill in your credentials

The Add Government Gateway Login pop-up will open. Complete the following fields:

Government Gateway portal - select Classic or MTD depending on which portal your credentials belong to. Most practices use Classic for Corporation Tax, PAYE and Self Assessment.

Tax types - tick the tax types this login has access to. You can select Corporation Tax, PAYE, Self Assessment, and Construction Industry Scheme.

Label - give this login a name to identify it, for example "Corp Tax" or "SA Login".

Government Gateway User ID - your agent User ID, up to 12 characters.

Password - your Government Gateway password.

2FA setup code - paste the secret key you copied from HMRC's authenticator setup screen. This is the long code shown in the box below the QR code, not the 6-digit rotating code.

Lastly, click Add Login.

If you have different logins for each portal, simply repeat the above process to add each login to your TaxScout Settings page.

Step 4: Verify the connection

Socket will show a Verify 2FA screen with a live 6-digit code that Socket has generated using your secret key. The code refreshes every 30 seconds.

There are two scenarios:

If you are setting up 2FA on your Government Gateway account for the first time, enter the 6-digit code shown on this screen into HMRC's confirmation screen, then come back to Socket and click Verify Connection.

If your Government Gateway account already has 2FA set up, just click Verify Connection. Socket will handle the rest automatically.

If you're not ready to verify yet, click I'll Verify Later to save your credentials without verifying. TaxScout won't be able to sync until the connection is verified. You can come back to verify at any time via TaxScout Settings under HMRC Connections.

Step 5: Sync begins

Once verified, TaxScout will start syncing immediately. You'll see a progress bar showing Corporation Tax, PAYE, and Self Assessment syncing in real time with a client count and ETA per tax type.

Troubleshooting

The secret key isn't working

Make sure you copied the full secret key from HMRC. It's the long string in the box below the QR code, not the 6-digit rotating code. If you scanned the QR code with your authenticator app rather than copying the key manually, go back into your HMRC security settings to find the written key.

The 6-digit code expired before I could submit it

Wait for the code to refresh. It updates every 30 seconds. The Verify 2FA screen shows a countdown next to the code.

I clicked I'll Verify Later. How do I come back to verify?

Go to TaxScout Settings, find the login under HMRC Connections, and click Verify next to it.

I get an error after clicking Verify Connection

Click Edit Credentials to go back and check your User ID, password and secret key are all correct. If the issue persists, get in touch with the team via the chat icon in Socket.

Did this answer your question?