wadahiro / keycloak-discord

Keycloak Identity Provider extension for Discord
121 stars 64 forks source link

Getting the error ''Failed to make identity provider oauth callback'' when trying to login with discord as external identity provider. #25

Closed smyatoka closed 1 year ago

smyatoka commented 1 year ago

after configuring discord as identity provider, i tried to use it for the first time for login, but after i enter my credential from the discord account console and submit, i get that error. image image

wadahiro commented 1 year ago

@smyatoka

Discord returns {"error": "invalid_client"}. This is probably due to an incorrect Client Secret. Please obtain the Client Secret from Discord again, set it to Keycloak, and try again.

xLEpEX commented 1 year ago

Hey, I still got the same error with a fresh regenerated secret. Are there any other possible reason for the error {"error": "invalid_client"}. I'm using the browser Authentication flow

2022-11-10 14:12:45,671 WARN  [org.keycloak.events] (executor-thread-306) type=IDENTITY_PROVIDER_LOGIN_ERROR, realmId=04a7818c-fb1d-464c-bec0-7576e7a610d8, clientId=react-test, userId=null, ipAddress=192.168.0.5, error=identity_provider_login_failure, code_id=fe40ae35-ea4a-4753-bb27-eee1fc28a095, authSessionParentId=fe40ae35-ea4a-4753-bb27-eee1fc28a095, authSessionTabId=ivpS2wfL7Og
2022-11-10 14:24:49,222 ERROR [org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider] (executor-thread-308) Failed to make identity provider oauth callback: org.keycloak.broker.provider.IdentityBrokerException: No access token available in OAuth server response: {"error": "invalid_client"}
    at org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider.getFederatedIdentity(AbstractOAuth2IdentityProvider.java:303)
    at org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider$Endpoint.authResponse(AbstractOAuth2IdentityProvider.java:502)
    at jdk.internal.reflect.GeneratedMethodAccessor792.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
    at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
    at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
    at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
    at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)
    at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:192)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:152)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:183)
    at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:141)
wadahiro commented 1 year ago

@xLEpEX From the Discord error response, the client authentication has failed. Please check if the client ID is also set correctly.