question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Keycloak returns 'Invalid parameter: redirect_uri'

See original GitHub issue

Describe the bug

Hi. As usual, when i want to login to the app, i go to this URL:

Base url: http://mywebsite.com/auth/admin/master/console/

http://mywebsite.com/auth/realms/master/protocol/openid-connect/auth?client_id=security-admin-console&redirect_uri=http%3A%2F%2Fmywebsite.com%2Fauth%2Fadmin%2Fmaster%2Fconsole%2F%23%2F&state=b548d1a4-0411-46d9-88c5-8775b1105f5d&response_mode=fragment&response_type=code&scope=openid&nonce=4ceedc72-7f1d-41ad-9e59-365199966c93&code_challenge=1FQ_4rLLd5JMGCpvezsnx4D1uVABKvzRchXEhtrUa2Y&code_challenge_method=S256

And i login without any problem. This is my security-admin-console settings belons master realm: Screenshot from 2022-03-30 09-17-42

Then, I created a different realm and a user belong to this realm. Base url: http://mywebsite.com/auth/admin/test/console/

I have no problem when I try to login from this link until i change theme to keycloak.v2.

It says: ‘Invalid parameter: redirect_uri’

And redirect to this URL:

http://mywebsite.com/auth/realms/master/protocol/openid-connect/auth?client_id=security-admin-console&redirect_uri=http%3A%2F%2Fmywebsite.com%2Fauth%2Fadmin%2Ftest%2Fconsole%2F%23%2F&state=8eda9d7c-e908-4d2d-9dbb-085d4b23d55e&response_mode=fragment&response_type=code&scope=openid&nonce=e227131d-6d77-43ba-95d4-ec91901a18a7&code_challenge=TKIH3x_qeRp_NwNsuMle-3IQ13Z0t9V7UW4GvAOMIQ8&code_challenge_method=S256

This is my security-admin-console settings belongs test realm: Screenshot from 2022-03-30 09-22-31

Any help would be greatly appreciated.

Version

15.0.2

Expected behavior

Should be able to login to different realm without any issues

Actual behavior

No response

How to Reproduce?

No response

Anything else?

I don’t have a problem working in localhost. I add ’ ?realm=“test” parameter to url, and it works. There is a code like this in environment.ts :

const realm =
  new URLSearchParams(window.location.search).get("realm") ?? "master";

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jonkoopscommented, Mar 30, 2022

Oh my bad, I went by the screenshots included in this issue which are from the old console. Re-opening.

1reaction
jonkoopscommented, Mar 30, 2022

This repository is for the development of the new Admin Console. If you are having issues with another component please report your issue on the main repository.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid redirect uri for "Valid Redirect URIs with https://*"
I am getting “Invalid redirect uri” on the keycloak sso page. What is the full URL of that 'keycloak sso page'. There is...
Read more >
Keycloak invalid redirect URL · Issue #11867 - GitHub
OAuth2 configuration with keycloak has incorrect set of valid redirect URL: ... is crashing with keycloak Invalid parameter: redirect_uri.
Read more >
'[keycloak-user] Invalid parameter: redirect_uri' - MARC
List: keycloak-user Subject: [keycloak-user] Invalid parameter: ... com [Download RAW message or body] Did you change the redirect uri for the client?
Read more >
Invalid parameter: redirect_uri - Google Groups
2017-09-21 18:04:31,995 WARN [org.keycloak.events] (default task-2) ... Have you really configured both (http and https) URI patterns as Valid Redirect URI.
Read more >
[keycloak-user] Reverse Proxy - Invalid parameter: redirect uri
... Reverse Proxy - SSL Termination - Invalid parameter: redirect uri ... return 301 https://$host$request_uri; } server { listen 443 ssl; ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found