diff --git a/CHANGES.rst b/CHANGES.rst
index 4a63425..0817943 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,6 +1,11 @@
 Changelog
 =========
 
+Version 0.5.1
+-------------
+
+- Fix compatibility with Python 3.8 and 3.9
+
 Version 0.5
 -----------
 
diff --git a/flask_multipass/__init__.py b/flask_multipass/__init__.py
index 97505a8..ea6d783 100644
--- a/flask_multipass/__init__.py
+++ b/flask_multipass/__init__.py
@@ -13,7 +13,7 @@ from .group import Group
 from .identity import IdentityProvider
 
 
-__version__ = '0.5'
+__version__ = '0.5.1'
 __all__ = ('Multipass', 'AuthProvider', 'IdentityProvider', 'AuthInfo', 'IdentityInfo', 'Group', 'MultipassException',
            'AuthenticationFailed', 'IdentityRetrievalFailed', 'GroupRetrievalFailed', 'NoSuchUser',
            'InvalidCredentials')
diff --git a/flask_multipass/util.py b/flask_multipass/util.py
index f328970..4131f2e 100644
--- a/flask_multipass/util.py
+++ b/flask_multipass/util.py
@@ -4,6 +4,7 @@
 # Flask-Multipass is free software; you can redistribute it
 # and/or modify it under the terms of the Revised BSD License.
 
+import sys
 from functools import wraps
 from importlib.metadata import entry_points as importlib_entry_points
 from inspect import getmro, isclass
@@ -143,14 +144,17 @@ def resolve_provider_type(base, type_, registry=None):
     if registry is not None and type_ in registry:
         cls = registry[type_]
     else:
-        entry_points = importlib_entry_points(group=base._entry_point, name=type_)
+        if sys.version_info < (3, 10):
+            entry_points = {ep for ep in importlib_entry_points().get(base._entry_point, []) if ep.name == type_}
+        else:
+            entry_points = importlib_entry_points(group=base._entry_point, name=type_)
         if not entry_points:
             raise ValueError('Unknown type: ' + type_)
         elif len(entry_points) != 1:
             # TODO: remove the getattr check after dropping python 3.8
             defs = ', '.join(getattr(ep, 'module', ep.value) for ep in entry_points)
             raise RuntimeError(f'Type {type_} is not unique. Defined in {defs}')
-        entry_point = entry_points[0]
+        entry_point = list(entry_points)[0]
         cls = entry_point.load()
     if not issubclass(cls, base):
         raise TypeError(f'Found a class {cls} which is not a subclass of {base}')

diff --git a/tests/test_core.py b/tests/test_core.py
index 0adada1..ef1e60b 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -218,3 +218,12 @@ def test_handle_auth_error_with_redirect(mocker):
         multipass.handle_auth_error(AuthenticationFailed(), redirect_to_login=True)
         assert flash.called
         redirect.assert_called_with(app.config['MULTIPASS_LOGIN_URLS'][0])
+
+
+def test_load_providers_from_entrypoints():
+    app = Flask('test')
+    app.config['SECRET_KEY'] = 'testing'
+    app.config['MULTIPASS_AUTH_PROVIDERS'] = {'test': {'type': 'static'}}
+    app.config['MULTIPASS_IDENTITY_PROVIDERS'] = {'test': {'type': 'static'}}
+    app.config['MULTIPASS_PROVIDER_MAP'] = {'test': 'test'}
+    Multipass(app)
diff --git a/tests/test_util.py b/tests/test_util.py
index 4fc6532..250fbee 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -4,6 +4,7 @@
 # Flask-Multipass is free software; you can redistribute it
 # and/or modify it under the terms of the Revised BSD License.
 
+import sys
 from importlib.metadata import EntryPoint
 
 import pytest
@@ -170,7 +171,7 @@ def test_login_view(mocker):
 
 
 class DummyBase:
-    _entry_point = 'dummy'
+    _entry_point = 'fakeproviders'
 
 
 class Dummy(DummyBase):
@@ -190,21 +191,29 @@ class MockEntryPoint(EntryPoint):
         return mapping[self.name]
 
 
-def mock_entry_point(name):
+def mock_entry_point(name, n=0):
     # we can't override MockEntryPoint's `__init__` to pass the default values since it's using
     # a namedtuple in Python<3.11, and required args are handled via __new__ in namedtuple
-    return MockEntryPoint(name, 'dummy.value', 'dummy.group')
+    return MockEntryPoint(name, f'dummy.value.{n}', 'dummy.group')
 
 
 @pytest.fixture
 def mock_entry_points(monkeypatch):
-    def _mock_entry_points(*, group, name):
-        return {
-            'dummy': [mock_entry_point('dummy')],
-            'fake': [mock_entry_point('fake')],
-            'multi': [mock_entry_point('dummy'), mock_entry_point('fake')],
-            'unknown': []
-        }[name]
+    MOCK_EPS = {
+        'fakeproviders': [
+            mock_entry_point('dummy'),
+            mock_entry_point('fake'),
+            mock_entry_point('multi'),
+            mock_entry_point('multi', 1),
+        ]
+    }
+
+    if sys.version_info < (3, 10):
+        def _mock_entry_points():
+            return MOCK_EPS
+    else:
+        def _mock_entry_points(*, group, name):
+            return [ep for ep in MOCK_EPS[group] if ep.name == name]
 
     monkeypatch.setattr('flask_multipass.util.importlib_entry_points', _mock_entry_points)
 

Type error on init_app
```
File ".../site-packages/flask_multipass/util.py", line 146, in resolve_provider_type
entry_points = importlib_entry_points(group=base._entry_point, name=type_)

TypeError: entry_points() for an unexpected keyword argument 'group'
```

I see this error and version 0.5 dies while loading.
It's trying to call `importlib.metadata.entrypoints` but that doesn't have a group argument.

tests/test_util.py::test_resolve_provider_type_invalid tests/test_util.py::test_resolve_provider_type
tests/test_core.py::test_init_app_twice tests/test_core.py::test_init_app_late tests/test_core.py::test_init_app_immediately tests/test_core.py::test_multiple_apps tests/test_core.py::test_initialize_providers tests/test_core.py::test_initialize_providers_unique tests/test_core.py::test_create_login_rule tests/test_core.py::test_create_login_rule_disabled tests/test_core.py::test_render_template tests/test_core.py::test_next_url tests/test_core.py::test_next_url_invalid tests/test_core.py::test_validate_next_url[foo-True] tests/test_core.py::test_validate_next_url[/foo-True] tests/test_core.py::test_validate_next_url[/foo?bar-True] tests/test_core.py::test_validate_next_url[/foo#bar-True] tests/test_core.py::test_validate_next_url[//localhost-True] tests/test_core.py::test_validate_next_url[//localhost/foo-True] tests/test_core.py::test_validate_next_url[http://localhost-True] tests/test_core.py::test_validate_next_url[https://localhost/-True] tests/test_core.py::test_validate_next_url[//evil-False] tests/test_core.py::test_validate_next_url[//evil.com-False] tests/test_core.py::test_validate_next_url[//evil.com:80-False] tests/test_core.py::test_validate_next_url[http://evil.com-False] tests/test_core.py::test_validate_next_url[https://evil.com-False] tests/test_core.py::test_login_finished tests/test_core.py::test_login_finished_returns tests/test_core.py::test_identity_handler tests/test_core.py::test_login_check tests/test_core.py::test_handle_auth_error tests/test_core.py::test_handle_auth_error_with_redirect tests/test_util.py::test_get_canonical_provider_map[config_map0-canonical_map0] tests/test_util.py::test_get_canonical_provider_map[config_map1-canonical_map1] tests/test_util.py::test_get_canonical_provider_map[config_map2-canonical_map2] tests/test_util.py::test_get_canonical_provider_map[config_map3-canonical_map3] tests/test_util.py::test_get_canonical_provider_map[config_map4-canonical_map4] tests/test_util.py::test_get_canonical_provider_map[config_map5-canonical_map5] tests/test_util.py::test_get_canonical_provider_map[config_map6-canonical_map6] tests/test_util.py::test_get_state_app_not_initialized tests/test_util.py::test_get_state_explicit tests/test_util.py::test_get_state tests/test_util.py::test_convert_provider_data[provider_data0-mapping0-None-result0] tests/test_util.py::test_convert_provider_data[provider_data1-mapping1-None-result1] tests/test_util.py::test_convert_provider_data[provider_data2-mapping2-None-result2] tests/test_util.py::test_convert_provider_data[provider_data3-mapping3-key_filter3-result3] tests/test_util.py::test_convert_provider_data[provider_data4-mapping4-key_filter4-result4] tests/test_util.py::test_convert_provider_data[provider_data5-mapping5-key_filter5-result5] tests/test_util.py::test_convert_provider_data[provider_data6-mapping6-key_filter6-result6] tests/test_util.py::test_convert_provider_data[provider_data7-mapping7-key_filter7-result7] tests/test_util.py::test_convert_provider_data[provider_data8-mapping8-key_filter8-result8] tests/test_util.py::test_convert_app_data[app_data0-mapping0-None-result0] tests/test_util.py::test_convert_app_data[app_data1-mapping1-key_filter1-result1] tests/test_util.py::test_convert_app_data[app_data2-mapping2-None-result2] tests/test_util.py::test_convert_app_data[app_data3-mapping3-None-result3] tests/test_util.py::test_convert_app_data[app_data4-mapping4-None-result4] tests/test_util.py::test_convert_app_data[app_data5-mapping5-None-result5] tests/test_util.py::test_convert_app_data[app_data6-mapping6-None-result6] tests/test_util.py::test_convert_app_data[app_data7-mapping7-None-result7] tests/test_util.py::test_convert_app_data[app_data8-mapping8-key_filter8-result8] tests/test_util.py::test_convert_app_data[app_data9-mapping9-key_filter9-result9] tests/test_util.py::test_convert_app_data[app_data10-mapping10-key_filter10-result10] tests/test_util.py::test_convert_app_data[app_data11-mapping11-key_filter11-result11] tests/test_util.py::test_convert_app_data[app_data12-mapping12-key_filter12-result12] tests/test_util.py::test_convert_app_data[app_data13-mapping13-key_filter13-result13] tests/test_util.py::test_convert_app_data[app_data14-mapping14-key_filter14-result14] tests/test_util.py::test_convert_app_data[app_data15-mapping15-key_filter15-result15] tests/test_util.py::test_convert_app_data[app_data16-mapping16-key_filter16-result16] tests/test_util.py::test_convert_app_data[app_data17-mapping17-key_filter17-result17] tests/test_util.py::test_convert_app_data[app_data18-mapping18-key_filter18-result18] tests/test_util.py::test_convert_app_data[app_data19-mapping19-key_filter19-result19] tests/test_util.py::test_convert_app_data[app_data20-mapping20-key_filter20-result20] tests/test_util.py::test_convert_app_data[app_data21-mapping21-key_filter21-result21] tests/test_util.py::test_convert_app_data[app_data22-mapping22-key_filter22-result22] tests/test_util.py::test_convert_app_data[app_data23-mapping23-key_filter23-result23] tests/test_util.py::test_convert_app_data[app_data24-mapping24-key_filter24-result24] tests/test_util.py::test_convert_app_data[app_data25-mapping25-key_filter25-result25] tests/test_util.py::test_get_provider_base tests/test_util.py::test_get_provider_base_invalid tests/test_util.py::test_login_view tests/test_util.py::test_resolve_provider_type_class tests/test_util.py::test_validate_provider_map[False-auth_providers0-identity_providers0-provider_map0] tests/test_util.py::test_validate_provider_map[False-auth_providers1-identity_providers1-provider_map1] tests/test_util.py::test_validate_provider_map[False-auth_providers2-identity_providers2-provider_map2] tests/test_util.py::test_validate_provider_map[False-auth_providers3-identity_providers3-provider_map3] tests/test_util.py::test_validate_provider_map[True-auth_providers4-identity_providers4-provider_map4] tests/test_util.py::test_validate_provider_map[True-auth_providers5-identity_providers5-provider_map5] tests/test_util.py::test_classproperty tests/test_util.py::test_supports_meta_no_support_attrs tests/test_util.py::test_supports_meta_ok[True] tests/test_util.py::test_supports_meta_ok[False] tests/test_util.py::test_supports_meta_fail[True] tests/test_util.py::test_supports_meta_fail[False] tests/test_util.py::test_supports_meta_inheritance[True] tests/test_util.py::test_supports_meta_inheritance[False] tests/test_util.py::test_supports_meta_multi tests/test_util.py::test_supports_meta_default_true