Skip to content

Required String parameter 'redirect_uri' is not present on OIDC logout with AWS cognito #14601

@thorin-schiffer

Description

@thorin-schiffer

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

While using st.logout() with AWS cognito configured over OIDC in the secrets.toml, the error is returned

Image
Required String parameter 'redirect_uri' is not present

The url is then

https://2015-40786-user-productflight.auth.eu-west-1.amazoncognito.com/error?client_id=5ceho48rc7uuvf044cl8okc6v1&post_logout_redirect_uri=https%3A%2F%2F2015-40786.cockpit.productflight.io%2Foauth2callback&id_token_hint=...

The log out is happening though, if you press back and return to the root app, the user is logged out.
Is post_logout_redirect_uri the culprit?

Reproducible Code Example

secrets.toml...
[auth]
redirect_uri = "http://localhost:8501/oauth2callback"
cookie_secret = "123"
client_id = "xxx"
client_secret = "yyy"
server_metadata_url = "https://cognito-idp.eu-west-1.amazonaws.com/eu-west-1_B5Zn6WAh4/.well-known/openid-configuration"



streamlit...
        if st.user.is_logged_in:
            if st.button("Logout", key="logout", type="tertiary"):
                logout()
            return
        st.login()

Steps To Reproduce

  1. Login with the OIDC AWS Cognito configured
  2. Logout
  3. See error
  4. Press back button in the browser
  5. User logged out

Expected Behavior

User logged out and redirected to the login screen

Current Behavior

No response

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version:1.55.0
  • Python version:3.12.11
  • Operating System: Ubuntu 22
  • Browser: chrome

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:authenticationRelated to user authenticationfeature:st.loginRelated to `st.login` commandpriority:P3Medium prioritystatus:confirmedBug has been confirmed by the Streamlit teamtype:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions