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.

ambassador + keyclock logout redirect URL

See original GitHub issue

Please describe your use case / problem. A clear and concise description of your use case / problem. The “why” is really valuable to us. For example, “I have a set of services whose clients have long-lived connections.” Hi people, I’m trying redirect URL when I log out in my system. but I read the documentation and not exist de parameter of URL redirect. this documentation than I read https://www.getambassador.io/docs/latest/topics/using/filters/oauth2/#rp-initiated-logout I’m using keyclock of SSO

Describe the solution you’d like A clear and concise description of what you want to happen. in documentation tell to set the ‘realm’. I wanted (need) to set URL after redirect for example

function logout(realm) {
    var form = document.createElement('form');
    form.method = 'post';
    form.action = '/.ambassador/oauth2/logout?realm='+realm;
    //form.target = '_blank'; // uncomment to open the identity provider's page in a new tab
    var xsrfInput = document.createElement('input');
    xsrfInput.type = 'hidden';
    xsrfInput.name = '_xsrf';
    xsrfInput.value = getCookie("ambassador_xsrf."+realm);
  var urlredirect = document.createElement('input');
    urlredirect.type = 'hidden';
    urlredirect.name = urlRedirect';
    urlredirect.value = 'https://website.com.br';
    form.appendChild(xsrfInput);
    document.body.appendChild(form);
    form.submit();
}

and after executing the code call this URL http://auth-server/auth/realms/{realm}/protocol/openid-connect/logout?redirect_uri=encodedRedirectUri

this is documentation to redirect in keyclock https://www.keycloak.org/docs/latest/securing_apps/index.html#logout

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
FernandezAnibalcommented, Nov 28, 2020

Hello, I found a solution for that, is not the best solution but you will can logout using a button.

async function logout() { const data = new URLSearchParams("realm=keycloak-oauth2-filter.ambassador") data.append('_xsrf', getCookie("ambassador_xsrf.keycloak-oauth2-filter.ambassador")); fetch('/.ambassador/oauth2/logout', { method: 'POST', body: data }) .then(function (response) { if (response.ok) { return response.text() } else { throw "Err"; } }) .then(function (text) { console.log(text); }) .catch(function (err) { console.log(err); }); }

0reactions
cindymullins-dwcommented, Oct 22, 2022

Post Logout Redirect URI support for Oauth2 Filter was released with v3.2. Please see release notes here for details .

Read more comments on GitHub >

github_iconTop Results From Across the Web

ambassador + keyclock logout redirect URL #2869 - GitHub
Hello, I found a solution for that, is not the best solution but you will can logout using a button. async function logout()...
Read more >
How to specify redirectUrl after logout for Ambassador OAuth2 ...
The URL Ambassador redirects to looks as follows: http://auth-serve}/auth/realms/{realm-name}/protocol/openid-connect/logout . But for ...
Read more >
The OAuth2 Filter | Edge Stack
If Post Logout Redirect is configured in your IDP to {{ORIGIN}}/.ambassador/oauth2/post-logout-redirect then, after a successful logout, a redirect is issued to ...
Read more >
Invalid redirect uri but redirect uri are configured in client
Hi! I'm configuring a client for SSO in Google Workspace using Keycloak as IDP. Everything is working fine with the exception of logout....
Read more >
The Complete Guide to Vue.js User Authentication with Auth0
Learn how to add login, logout, and sign-up to Vue.js using a plugin, how to ... The above value is the URL that...
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