Cannot logout airflow app using Okta


I am using Okta for my airflow authentication. I am able to manage to login airflow by using Okta but could not make logout worked.

Following this doc:

I get the id token to put in id_token_hint but it shows 404 “page not found” when I clicked logout link on airflow…mWtUAavYIbW2SdxAcWttF73Xvha4AlWY6cIxMoOWPa1CKMA&post_logout_redirect_uri=http%3A//

This is logout code:

@expose(’/logout/’, methods=[‘GET’, ‘POST’])
def logout(self):

oidc =
id_token = oidc.get_access_token()

print("ID TOKEN LOGOUT {} ".format(id_token))

super(AuthOIDCView, self).logout()
redirect_url = request.url_root.strip(
    '/') + self.appbuilder.get_url_for_login

issuer_uri = oidc.client_secrets.get('issuer')
logout_uri = f'{issuer_uri}/logout?id_token_hint={id_token}&post_logout_redirect_uri='

    logout_uri =['OIDC_LOGOUT_URI']

return redirect(logout_uri + quote(redirect_url))

I am not sure what I have done wrong.

Could you please guide me how to fix this issue?

@calvin You may take a look in the console log where the page redirect to. You can check it from browser inspect. Make sure you issuer URL in your code is the same with your auth server.
Also, I attached guides here for your reference:
The OpenID Connect Core specification could be helpful.
Related issue discussion.

@Lijia the issuer URL is the same with my auth server (double checked)
Because I used the custom Authorization server so do I have to set something up on this custom auth server?

the post_logout_redirect_uri=http%3A// URL is matched with the config I set in App General config logout URI