Hello,
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: https://developer.okta.com/docs/reference/api/oidc/?_ga=2.147371892.217170194.1607979248-697717913.1593713664#logout
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
https://org-name.okta-emea.com/oauth2/aus4oxe6lcrORtml10i7/logout?id_token_hint=eyJraWQiOi…mWtUAavYIbW2SdxAcWttF73Xvha4AlWY6cIxMoOWPa1CKMA&post_logout_redirect_uri=http%3A//airflow-app.dev.example.io/login/
This is logout code:
@expose(’/logout/’, methods=[‘GET’, ‘POST’])
def logout(self):
oidc = self.appbuilder.sm.oid
id_token = oidc.get_access_token()
print("ID TOKEN LOGOUT {} ".format(id_token))
oidc.logout()
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='
if 'OIDC_LOGOUT_URI' in self.appbuilder.app.config:
logout_uri = self.appbuilder.app.config['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?