Skip to content

Can't work with Google Oauth2 using qaurkus-oidc #30333

Closed
@pmlopes

Description

Describe the bug

I'm trying to help a user secure a simple API with Google/Azure as they did with Vert.x, however we cannot start the application on our development environments as quarkus-oidc assumes that oidc is using Keycloak for some unknown reason.

2023-01-12 13:33:37,383 INFO  [io.qua.oid.dep.dev.OidcDevConsoleProcessor] (build-4) OIDC Dev Console: discovering the provider metadata at https://accounts.google.com/.well-known/openid-configuration
2023-01-12 13:33:38,257 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.lang.StringIndexOutOfBoundsException: Range [0, -1) out of bounds for length 27
	at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:55)
	at java.base/jdk.internal.util.Preconditions$1.apply(Preconditions.java:52)
	at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:213)
	at java.base/jdk.internal.util.Preconditions$4.apply(Preconditions.java:210)
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:98)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex(Preconditions.java:112)
	at java.base/jdk.internal.util.Preconditions.checkFromToIndex(Preconditions.java:349)
	at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4611)
	at java.base/java.lang.String.substring(String.java:2723)
	at io.quarkus.keycloak.pep.runtime.KeycloakPolicyEnforcerRecorder.createPolicyEnforcer(KeycloakPolicyEnforcerRecorder.java:70)

The setup:

# Configuration file
%prod.quarkus.oidc.auth-server-url=https://accounts.google.com
quarkus.oidc.auth-server-url=https://accounts.google.com
quarkus.oidc.client-id=my-own-client-id-long-code.apps.googleusercontent.com
quarkus.oidc.credentials.secret=my-own-client-secret-long-code

Expected behavior

It is expected that users will use other providers than Keycloak. It doesn't seem trivial to find this information on the documentation.

Actual behavior

No response

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

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

No response

Additional information

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions