---
title: "Geo-Location Authenticator Filter"
description: "How to set up a geo-location filter to limit the authenticators presented to a user."
url: "https://curity.io/resources/learn/geolocation-authenticator-filter/"
date: "2020-04-21"
area: "tutorials"
topic: "howtos"
pagegroup: "authentication"
---

# Geo-Location Authenticator Filter

## Geo-Location Authenticator Filter

Authenticator filters are a way to improve user experience when authenticating with the Curity Identity Server. Many different authenticators can be configured for use with the Curity Identity Server, but sometimes you will want to limit the use of some authenticators based on some factors. E.g. you know that the Active Directory login form will work only when a user is connected via a VPN. So why show them the AD form option if they are not using the VPN? Authenticator filters are a way to achieve this goal.

One of the different filters you can use to narrow down the available authenticators is the `geo-country` filter. It enables you to filter out given authenticators based on the country of the user's location (based on the IP address).

The filter can work in two ways. It can filter out an authenticator if:

-   the user is in one of the countries on the list
-   the user is **not** in one of the countries on the list

### Configuring the Filter

Let's say you have a service whose customers are located in different European countries. For your Swedish customers you enable the BankID authenticator which is very popular in that country. It allows customers to authenticate using their bank credentials. But this authentication method might not be known to your customers living outside of the Nordics. So, to improve user experience, you want to hide the BankID authenticator to users who log in from outside of the Nordics area. Since they will not be familiar with this method anyway, so why confuse them?

Authenticator filters are not a security feature

Remember that users can still access an authenticator by calling its URL directly, so authenticator filters should only be used as a mean of enhancing user experience.

To set it up:

-   Go to the **Authentication Profile**
-   Choose **Filters** from the main menu
-   Click on **New Filter**, enter a name for the filter and click **Create**
-   Choose the **Geo Country** type

![New filter](https://curity.io/images/resources/geolocation/newfilter.jpg?v=20250701)

-   In the **Exclusions** box add the authenticators which should be hidden when the conditions of the filter are met. Assuming that you want to hide the BankID authenticator and that the authenticator in your system is named `bankid`, then add that value to the list.
    
-   In **Filter Countries** list select the countries which you want to be affected by the filter. You can search for the countries using the ISO country code or the country name.
    
-   If you want to hide the authenticator to users which are in the countries you added to the list, make sure the **Apply Filter When Match** option is `on`. If you to hide the authenticator from any user who is _not_ in one of the countries on the list, turn the switch to `off`.
    

To hide the BankID authenticator to users outside of Nordics use the following settings:

![New filter](https://curity.io/images/resources/geolocation/filtercountries.jpg?v=20250701)

### Applying the Filter

Authenticator filters can be applied either to [Service Providers](https://curity.io/docs/identity-server/profiles/authentication-profile/standalone-integration-federation-servers/service-providers/) or [OAuth Clients](https://curity.io/docs/identity-server/profiles/token-profile/clients/client-config/#user-authentication). Edit the respective object and select the new filter in the **Authenticator Filters** field to add to a list of active filters. If you're adding the filter to a client, you can find the field in **User Authentication** tab, in the **Advanced** section.

![Apply a filter](https://curity.io/images/resources/geolocation/applyfilter.jpg?v=20250701)

Remember to commit the settings once you're done.

### Testing

Assuming that you've added the filter as shown above and have two other authenticators enabled for a client: "Login with Google" and "Username & Password" (html form) the login screen will look like the one below, if th user was in of the Nordic countries:

![Login from Nordics](https://curity.io/images/resources/geolocation/withbankid.jpg?v=20250701)

Users in other countries will see this login form:

![Login from other country](https://curity.io/images/resources/geolocation/withoutbankid.jpg?v=20250701)

### Continue Reading

If you want to block access to authenticators based on the user's location have a look at the different options described in the [Using Geo-Location in the Curity Identity Server](https://curity.io/resources/learn/geolocation-overview/) article.

If you want to learn more about authenticator filters have a look at the [product documentation](https://curity.io/docs/identity-server/profiles/authentication-profile/authenticator-filters/).
