Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get id_token for send to the URL logout keycloak #3694

Open
Oswaldo200818 opened this issue Mar 21, 2024 · 0 comments
Open

Get id_token for send to the URL logout keycloak #3694

Oswaldo200818 opened this issue Mar 21, 2024 · 0 comments

Comments

@Oswaldo200818
Copy link

Oswaldo200818 commented Mar 21, 2024

Hello, I am generating an application with django-allauth == 0.61.1 and Keycloak 22 In this version of keycloak you must send two parameters: post_logout_redirect_uri and id_token_hint to send to the logout endpoint and perform this process both in the application and in keycloak, but I don't know how to get the id_token to send to the endpoint. This way I have been implementing it but it does not get the id_token:

def logout_view(request):

    id_token = request.session.get('id_token')


    post_logout_redirect_uri = 'http://app.com/'


    params = {
        'client_id': 'client_id_de_keycloak',  
        'post_logout_redirect_uri': post_logout_redirect_uri,
    }


    if id_token:
        params['id_token_hint'] = id_token


    logout_url = f"https://auth.apps.openshift.entity.cloud/realms/reaml/protocol/openid-connect/logout?{urlencode(params)}"


    request.session.flush()
return redirect(logout_url)

1.- What is the correct way to get the id_token ?
2.- Has anyone had a similar problem ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant