def test_oauth_user_info_authentik_with_jwt_validation_without_signature(self):
        """
        Tests if an unsigned token raises an error if verify_signature is set to True
        """
        self.app.config["OAUTH_PROVIDERS"] = [
            {
                "name": "authentik",
                "token_key": "access_token",
                "icon": "fa-fingerprint",
                "remote_app": {
                    "api_base_url": "https://authentik.mydomain.com",
                    "client_kwargs": {
                        "scope": "email profile",
                        "verify_signature": True,
                    },
                    "access_token_url": (
                        "https://authentik.mydomain.com" "/application/o/token/"
                    ),
                    "authorize_url": (
                        "https://authentik.mydomain.com/" "application/o/authorize/"
                    ),
                    "request_token_url": None,
                    "client_id": "CLIENT_ID",
                    "client_secret": "CLIENT_SECRET",
                    "jwks_uri": (
                        "https://authentik.mydomain.com/"
                        "application/o/APPLICATION_NAME/jwks/"
                    ),
                },
            },
        ]

        self.appbuilder = AppBuilder(self.app, self.db.session)
        claims = {
            "iss": "https://authentik.mydomain.com/application/o/flask-appbuilder-test/",
            "sub": "2ac1102e7cf5a4b1cb2dd5adbe4761c551691ecd88991f78d0195d4d3d0cfcfa",
            "aud": "CLIENT_ID",
            "exp": 1703257941,
            "iat": 1700665941,
            "auth_time": 7282182129,  # 100 years from now ;)
            "acr": "goauthentik.io/providers/oauth2/default",
            "at_hash": "cAydO2DJMi_ZL6opx3eUdw",
            "email": "alice@example.com",
            "email_verified": True,
            "name": "Alice",
            "given_name": "Alice Doe",
            "preferred_username": "alice@example.com",
            "nickname": "alice",
            "groups": ["GROUP_1", "GROUP_2"],
        }
        from unittest.mock import MagicMock

        unsigned_jwt = jwt.encode(claims, key=None, algorithm="none")
        self.appbuilder.sm._get_authentik_jwks = MagicMock(return_value={})
        with self.assertRaises(InvalidLoginAttempt):
            self.appbuilder.sm.get_oauth_user_info(
                "authentik", {"access_token": "", "id_token": unsigned_jwt}
            )

        Tests if an unsigned token raises an error if verify_signature is set to True
        
tests/security/test_auth_oauth.py