Hello
I want to use “oauth2_introspection” authenticator handler to limit access to my custom api.
After several days of playing around I ended up with the following error:
oathkeeper-proxy_1 | time="2018-06-20T12:29:58Z" level=info msg="started handling request" method=GET remote="192.168.76.5:12336" request=/api/Values
hydra_1 | time="2018-06-20T12:29:58Z" level=info msg="started handling request" method=POST remote="172.19.249.121:55012" request=/oauth2/introspect
hydra_1 | time="2018-06-20T12:29:58Z" level=info msg="completed handling request" measure#http://localhost:4444.latency=327700 method=POST remote="172.19.249.121:55012" request=/oauth2/introspect status=200 text_status=OK took="327.7µs"
oathkeeper-proxy_1 | time="2018-06-20T12:29:58Z" level=warning msg="The authentication handler encountered an error" access_url="http://localhost:4455/api/Values" authentication_handler=oauth2_introspection error="json: cannot unmarshal string into Go struct field IntrospectionResponse.aud of type []string" granted=false reason_id=authentication_handler_error
oathkeeper-proxy_1 | time="2018-06-20T12:29:58Z" level=warning msg="Access request denied" access_url="http://localhost:4455/api/Values" error="json: cannot unmarshal string into Go struct field IntrospectionResponse.aud of type []string" granted=false
oathkeeper-proxy_1 | time="2018-06-20T12:29:58Z" level=error msg="An error occurred while handling a request" code=500 details="map[]" error="json: cannot unmarshal string into Go struct field IntrospectionResponse.aud of type []string" reason= request-id= status= trace="Stack trace: \ngithub.com/ory/oathkeeper/vendor/github.com/ory/keto/authentication.(*OAuth2IntrospectionAuthentication).Introspect\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/ory/keto/authentication/oauth2_introspection.go:173\ngithub.com/ory/oathkeeper/proxy.(*AuthenticatorOAuth2Introspection).Authenticate\n\t/go/src/github.com/ory/oathkeeper/proxy/authenticator_oauth2_introspection.go:68\ngithub.com/ory/oathkeeper/proxy.(*RequestHandler).HandleRequest\n\t/go/src/github.com/ory/oathkeeper/proxy/request_handler.go:99\ngithub.com/ory/oathkeeper/proxy.(*Proxy).Director\n\t/go/src/github.com/ory/oathkeeper/proxy/proxy.go:121\ngithub.com/ory/oathkeeper/proxy.(*Proxy).Director-fm\n\t/go/src/github.com/ory/oathkeeper/cmd/serve_proxy.go:213\nnet/http/httputil.(*ReverseProxy).ServeHTTP\n\t/usr/local/go/src/net/http/httputil/reverseproxy.go:169\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.Wrap.func1\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:46\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:29\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.middleware.ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:38\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:38\ngithub.com/ory/oathkeeper/vendor/github.com/ory/metrics-middleware.(*MetricsManager).ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/ory/metrics-middleware/middleware.go:160\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.middleware.ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:38\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.(middleware).ServeHTTP-fm\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:38\ngithub.com/ory/oathkeeper/vendor/github.com/meatballhat/negroni-logrus.(*Middleware).ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/meatballhat/negroni-logrus/middleware.go:136\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.middleware.ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:38\ngithub.com/ory/oathkeeper/vendor/github.com/urfave/negroni.(*Negroni).ServeHTTP\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/urfave/negroni/negroni.go:96\ngithub.com/ory/oathkeeper/vendor/github.com/rs/cors.(*Cors).Handler.func1\n\t/go/src/github.com/ory/oathkeeper/vendor/github.com/rs/cors/cors.go:200\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1947\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2694\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1830\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:2361" writer=JSON
oathkeeper-proxy_1 | time="2018-06-20T12:29:58Z" level=info msg="completed handling request" measure#oathkeeper-proxy.latency=11641500 method=GET remote="192.168.76.5:12336" request=/api/Values status=500 text_status="Internal Server Error" took=11.6415ms
The error itself is: json: cannot unmarshal string into Go struct field IntrospectionResponse.aud of type []string
Any ideas?