ory / hydra

The most scalable and customizable OpenID Certified™ OpenID Connect and OAuth Provider on the market. Become an OpenID Connect and OAuth2 Provider over night. Broad support for related RFCs. Written in Go, cloud native, headless, API-first. Available as a service on Ory Network and for self-hosters.
https://www.ory.sh/?utm_source=github&utm_medium=banner&utm_campaign=hydra
Apache License 2.0
15.5k stars 1.49k forks source link

Unable to request id_token #1672

Closed foresx closed 4 years ago

foresx commented 4 years ago

Describe the bug

I'm tring to use implicit flow to request the token and the id_token.

Reproducing the bug

Steps to reproduce the behavior:

Server logs

time="2020-01-04T06:28:44Z" level=error msg="An error occurred" description="The authorization server does not support obtaining a token using this method" error=unsupported_response_type hint="The client is not allowed to request response_type \"token id_token\"."
time="2020-01-04T06:28:44Z" level=debug msg="Stack trace: \ngithub.com/ory/fosite.(*Fosite).validateResponseTypes\n\t/go/pkg/mod/github.com/ory/fosite@v0.30.2/authorize_request_handler.go:210\ngithub.com/ory/fosite.(*Fosite).NewAuthorizeRequest\n\t/go/pkg/mod/github.com/ory/fosite@v0.30.2/authorize_request_handler.go:260\ngithub.com/ory/hydra/oauth2.(*Handler).AuthHandler\n\t/go/src/github.com/ory/hydra/oauth2/handler.go:616\ngithub.com/julienschmidt/httprouter.(*Router).ServeHTTP\n\t/go/pkg/mod/github.com/julienschmidt/httprouter@v1.2.0/router.go:334\ngithub.com/urfave/negroni.Wrap.func1\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:46\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2007\ngithub.com/ory/hydra/x.RejectInsecureRequests.func1\n\t/go/src/github.com/ory/hydra/x/tls_termination.go:55\ngithub.com/urfave/negroni.HandlerFunc.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:29\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/ory/x/metricsx.(*Service).ServeHTTP\n\t/go/pkg/mod/github.com/ory/x@v0.0.85/metricsx/middleware.go:261\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/ory/hydra/metrics/prometheus.(*MetricsManager).ServeHTTP\n\t/go/src/github.com/ory/hydra/metrics/prometheus/middleware.go:26\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/meatballhat/negroni-logrus.(*Middleware).ServeHTTP\n\t/go/pkg/mod/github.com/meatballhat/negroni-logrus@v0.0.0-20170801195057-31067281800f/middleware.go:136\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/ory/x/tracing.(*Tracer).ServeHTTP\n\t/go/pkg/mod/github.com/ory/x@v0.0.85/tracing/middleware.go:33\ngithub.com/urfave/negroni.middleware.ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:38\ngithub.com/urfave/negroni.(*Negroni).ServeHTTP\n\t/go/pkg/mod/github.com/urfave/negroni@v1.0.0/negroni.go:96\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2802\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1890\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"

Server configuration

Expected behavior

I want to get the id_token so that we can assign a logout_url when my client perform logout flow.

Environment 1.1.0 ory-hydra with helm chart

Additional context

Add any other context about the problem here.

foresx commented 4 years ago

fixed this problem with setting client config: "response_types": [ "id_token", "token", "code", "id_token token" ]

foresx commented 4 years ago

get idea from this issue. https://github.com/ory/fosite/issues/304

please help me to close this issue. @aeneasr

aeneasr commented 4 years ago

The response types you posted appear to be correct. I think you're probably getting a different issue now?

foresx commented 4 years ago

The response types you posted appear to be correct. I think you're probably getting a different issue now?

I fixed this problem by adding a new response types "id_token token". I'm having no problems now.

aeneasr commented 4 years ago

Glad you were able to solve it!