Skip to content

OIDC authentication via Google fails on Tomcat #728

@tfield

Description

@tfield

Expected Behavior

When using OIDC authentication with Google and Tomcat, I expect to be able to log in successfully.

The Micronaut Guide SECURE A MICRONAUT APPLICATION WITH GOOGLE was followed, and the server was changed from netty to tomcat, and this fails.

This seems similar to
#239
which includes links to
#256
#275

Actual Behaviour

The callback URL fails with the following exception

ERROR i.m.http.server.RouteExecutor - Unexpected error occurred: Error instantiating bean of type [io.micronaut.security.oauth2.endpoint.authorization.response.DefaultOpenIdAuthorizationResponse]: Error decoding request body: Stream closed

This works fine with Netty.

mn-tomcat-google-error.txt

Steps To Reproduce

  1. download the java/gradle micronaut guide sample from here.
  2. configure google client id/secret per your google console
  3. start and test the app to authenticate
  4. observe success
  5. edit build.gradle and change micronaut.runtime from 'netty' to 'tomcat', and add implementation("io.micronaut.servlet:micronaut-http-server-tomcat")
  6. restart the app and test to authenticate
  7. observe the stack trace

Environment Information

  • macOS Sonoma
  • azul 21 jdk

Example Application

Download the java/gradle micronaut guide sample from here.

Version

4.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions