JWT Grafana auth token - 'No keys found'

Hello, have somebody have issues by using JWT tokens url auth?

I followed this tutorial new in grafana 9.1 but I’m getting “Invalid JWT” error message

these are my settings

[auth.jwt]
enabled = true
enable_login_token = true
url_login = true
header_name = X-Forwarded-Access-Token
email_claim = email
username_claim = loginid
jwk_set_file = c:\\Grafana\\jwks.json
cache_ttl = 60m
expect_claims = {"iss": "grafana.local"}
auto_sign_up = true

this is my jwks.json (I used the sample for testing)

{
	"keys": [
		{
			"kid": "On2FQuJ8Y-909uJGWQEDkbzG-GRNmMc43HslEgVv_VQ",
			"kty": "RSA",
			"alg": "RS256",
			"use": "sig",
			"n": "qDmQHfTcOQOzmNJbVvtvuS8p_EgmiscP7vA_PZNyKx9O7utyGuoAmJH8e2w8gLIDDWHl5_x8aAIl_-TTPTSiyX8I68ryIdR28ZSe5u4pRdpXCVvJpOefKNIxQCTH7rs4KuRj0HZ2u1mu1Vz5_CeCCoKwKSmheD3u1xTJ8-VxQmdqfGxhuKtnkof7977HWOWy4GLDFqxyYHgihP_MmSeTmXUhVeZI6IOCqHMpF8eFWVGKM6V8rIKf8QO2K_vDJBM_3C933vMY8mqSQXbI3G54x-0myAaQXr4JkxjvUGKg5YC3ZXw7AjfZv_W_fQOG0GYp2hQ0akR4KNKT3XPNmpMVlQ",
			"e": "AQAB",
			"x5c": [
				"MIICnTCCAYUCBgF+u1ir8jANBgkqhkiG9w0BAQsFADASMRAwDgYDVQQDDAdncmFmYW5hMB4XDTIyMDIwMjE2NDkxN1oXDTMyMDIwMjE2NTA1N1owEjEQMA4GA1UEAwwHZ3JhZmFuYTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKg5kB303DkDs5jSW1b7b7kvKfxIJorHD+7wPz2TcisfTu7rchrqAJiR/HtsPICyAw1h5ef8fGgCJf/k0z00osl/COvK8iHUdvGUnubuKUXaVwlbyaTnnyjSMUAkx+67OCrkY9B2drtZrtVc+fwnggqCsCkpoXg97tcUyfPlcUJnanxsYbirZ5KH+/e+x1jlsuBiwxascmB4IoT/zJknk5l1IVXmSOiDgqhzKRfHhVlRijOlfKyCn/EDtiv7wyQTP9wvd97zGPJqkkF2yNxueMftJsgGkF6+CZMY71BioOWAt2V8OwI32b/1v30DhtBmKdoUNGpEeCjSk91zzZqTFZUCAwEAATANBgkqhkiG9w0BAQsFAAOCAQEABlW64QxuREB81VMGsyhj4Q5RykFaVuD5O8YlwUpmVfAVLzb0Drf54Kn4bnpnckKyYV+T+HsN4QXt81UE41xH0Aai2H3vrGH+PJf6aLPCDE+jpMqtN3n6IgImJXJPL8upMfhhWDv4nkM4uynEwWupzmrKi4oJuTETSMktJby4o6//XWnCzCVMoAGFJU4gtjBUzOMLW26zD+yc+BuUtfR3HzItVHSZKQSNSFO0kVS68RgrER8qJw07z3BOJ2bPpPM0PYyEngGMaowz/T6lI32ymGMWYMAnslthS1KAW9xcTBwnrW1nMhe5a0LPxIktys/wJtxIHZLc5sOddGT4xYklLg=="
			],
			"x5t": "prs-h1NBqOSJMH-tQWLTqguWets",
			"x5t#S256": "YjK3HobZW8xbNL1IPDgFhCM41UC5c0hG2cxaF6v961Q"
		}
	]
}

I check the logs

logger=auth.jwt t=2022-08-28T01:50:30.939371-05:00 level=debug msg="Parsing JSON Web Token"
logger=context traceID=00000000000000000000000000000000 t=2022-08-28T01:50:30.939371-05:00 level=debug msg="Failed to verify JWT" error="no keys found"
logger=context traceID=00000000000000000000000000000000 t=2022-08-28T01:50:30.939371-05:00 level=error msg="Invalid JWT" error="no keys found" traceID=00000000000000000000000000000000
logger=context traceID=00000000000000000000000000000000 userId=0 orgId=0 uname= t=2022-08-28T01:50:30.939371-05:00 level=info msg="Request Completed" method=GET path=/d/kaRdDzZVz/current-otb status=401 remote_addr=127.0.0.1 time_ms=0 duration=43.1µs size=71 referer= traceID=00000000000000000000000000000000
logger=token t=2022-08-28T01:50:30.9720657-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=context userId=0 orgId=0 uname= t=2022-08-28T01:50:30.9733302-05:00 level=info msg="Request Completed" method=GET path=/favicon.ico status=302 remote_addr=127.0.0.1 time_ms=2 duration=2.262ms size=29 referer="http://grafana.local:3031/d/kaRdDzZVz/current-otb?kiosk=&orgId=1&refresh=1m"
logger=token t=2022-08-28T01:50:30.9753593-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9767487-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777932-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=accesscontrol enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=admin enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=analytics enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=analytics.writers enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=auditing enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=caching enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=caching.api enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=caching.queries enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=caching.resources enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=config.vault enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=dspermissions enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=dspermissions.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=encryption.aesgcm enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=enterprise.plugins enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=kms.encryption enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=ldapdebug enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=ldapsync enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=provisioning enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=recordedqueries enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=reports enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=reports.creation enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=reports.email enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=reports.pdf enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=saml enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=teamsync enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=teamgroupsync enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=userlimits enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9777994-05:00 level=debug msg=FeatureEnabled feature=whitelabeling enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=secrets.remote_plugin_check t=2022-08-28T01:50:30.9777994-05:00 level=debug msg="remote secret managements plugin disabled because the property `secrets.use_plugin` is not set to `true`"
logger=token t=2022-08-28T01:50:30.9788235-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9788295-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=infra.kvstore.sql t=2022-08-28T01:50:30.9793631-05:00 level=debug msg="kvstore value not found" orgId=0 namespace=serviceaccounts key=hideApiKeys
logger=token t=2022-08-28T01:50:30.9793631-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9793631-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9798657-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9799119-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9799119-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9799119-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9799119-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9799119-05:00 level=debug msg=FeatureEnabled feature=reports enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9804148-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.9804148-05:00 level=debug msg=FeatureEnabled feature=accesscontrol enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=admin enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=analytics enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=analytics.writers enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=auditing enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=caching enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=caching.api enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=caching.queries enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=caching.resources enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=config.vault enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=dspermissions enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=dspermissions.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=encryption.aesgcm enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=enterprise.plugins enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=kms.encryption enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=ldapdebug enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=ldapsync enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=provisioning enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=recordedqueries enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=reports enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=reports.creation enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=reports.email enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=reports.pdf enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=saml enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=teamsync enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=teamgroupsync enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=userlimits enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=whitelabeling enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=accesscontrol.enforcement enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]
logger=token t=2022-08-28T01:50:30.980455-05:00 level=debug msg=FeatureEnabled feature=whitelabeling enabled=false licenseStatus=NotFound hasLicense=false hasValidLicense=false products=[]

Does kid in your jwt matching kid in jwks?