Skip to content

OIDC login not work #30797

Closed
Closed
@jie-huang

Description

@jie-huang

Describe the bug

A simple OIDC app works at version 2.11.1.Final.
But, it fails at version 2.13.7.Final, 2.16.1.Final.

Expected behavior

It should work.

Actual behavior

  • 2.13.7.Final, /oidc/login-callback path cannot find, 404
  • 2.16.1.Final, redirect between /test/login and /oidc/login-callback,
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

How to Reproduce?

Please ref https://github.com/jie-huang/quarkus-oidc for example project.
Or, you can generate a simple OIDC web-app.

@Path("/test")
public class Session {
  @Inject
  OidcSession oidcSession;

  @GET
  @Path("/login")
  @RolesAllowed("**")
  public Response login() throws URISyntaxException {
    return Response.seeOther(new URI("/test/data")).build();
  }

  @GET
  @Path("/data")
  @RolesAllowed("**")
  public Response data() {
    return Response.ok("<!doctype html><html><head><title>test</title></head><body>login successfully</body></html>")
      .header("Content-Type", "text/html;charset=UTF-8").build();
  }
}

main config

quarkus.oidc.application-type=web-app
quarkus.oidc.auth-server-url=xxxxxx
quarkus.oidc.authentication.pkce-required=true
quarkus.oidc.authentication.pkce-secret=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
quarkus.oidc.authentication.user-info-required=true
quarkus.oidc.client-id=xxxxxx
quarkus.oidc.roles.role-claim-path=groups
quarkus.oidc.roles.source=userinfo
quarkus.oidc.tls.verification=none

quarkus.oidc.authentication.error-path=/oidc/auth_error
quarkus.oidc.authentication.redirect-path=/oidc/login-callback
quarkus.oidc.authentication.restore-path-after-redirect=true
quarkus.oidc.authentication.scopes=email,offline_access
quarkus.oidc.logout.path=/oidc/logout
quarkus.oidc.logout.post-logout-path=/

In firefox, access path /test/login, it should login successfully and redirect to /test/data.

Output of uname -a or ver

Darwin sd-lmc-1a8902 21.6.0 Darwin Kernel Version 21.6.0: Mon Dec 19 20:46:01 PST 2022; root:xnu-8020.240.18~2/RELEASE_ARM64_T8101 arm64

Output of java -version

openjdk version "18" 2022-03-22

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.13.7.Final, 2.16.1.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Gradle 7.4.1

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions