-
Notifications
You must be signed in to change notification settings - Fork 29
invalid_grant: Incorrect redirect_uri #52
Comments
This error comes from your OIDC provider and it probably means that it doesn't allow the redirect_uri which this adapter specified as a query parameter when asking for a token. You can use browser DevTooks, Network tab to see all requests (you can enable Persist logs to keep logs between redirects) and inspect the redirect_uri. In the original adapter code, it was simply original request URI + /oidc/callback. If you have multiple URIs, you need to configure Keycloak for every oidc/callback URL for every URI you wish to protect. Or use my pull request which fixes that. :P |
In Keycloak, for my client I have set valid redirect uri to |
The error comes from IODC provider (Keycloak). I was even able to find the relevant line in the source code. Are you sure Keycloak understands I have my latest test image - it is made of all PRs I have submitted here so far - In short, this image implements these configurable functions:
Let me know how it works for you or if you need further assistance. |
To the best of my knowledge the wildcard ( When using the I think this is progress? :) Wondering if anyone has had success with this adapter and a Keycloak provider? I'd assume since the adapter and Keycloak are now 'in the same family' this could be a popular OIDC provider/client pairing in the future. |
This looks like the problem mentioned in #43 - createDefaultRules. There probably shouldn't be any default rules like this. You may try to define a custom policy as I wrote in the following comment on that issue. |
I was trying to integrate this adapter with Keycloak as well. Got stuck on the same things ( |
I've been researching the App Identity and Access Adapter for the frontend OIDC client needs of a custom REST service running within Istio. I've read through a blog post(https://istio.io/blog/2019/app-identity-and-access-adapter/) and the README file however, I've not been successful in my attempts to implement the adapter in my POC environment using Keycloak as the OIDC Provider.
When the adapter is not running I'm able to access my REST service with no problem. Once my
OidcConfig
and appPolicy
are applied, I'm correctly redirected for authN credentials however after login and redirection the browser shows the error:UNAUTHENTICATED:handler-appidentityandaccessadapter.handler.istio-system:invalid_grant: Incorrect redirect_uri
Logs from the
dpl-appidentityandaccessadapter
pod show:I've applied the following
OidcConfig
andPolicy
declarations:I've exhausted google searches and tweaked redirect_url settings on the Keycloak side - but I cannot seem to find further information how to resolve this error.
The text was updated successfully, but these errors were encountered: