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

401 error on UI when login with wrong user or password #356

Closed
mmartin24 opened this issue Oct 6, 2023 · 3 comments · Fixed by #357
Closed

401 error on UI when login with wrong user or password #356

mmartin24 opened this issue Oct 6, 2023 · 3 comments · Fixed by #357
Labels
kind/bug Something isn't working
Milestone

Comments

@mmartin24
Copy link
Contributor

Issue

When an user enters wrong credentialls on ui, a 401 error appears

Steps to reproduce

  • Deploy latest Epinio server version (v1.10.0-15-g47ee6f4e) and either of these ui images: ghcr.io/epinio/epinio-ui:v1.10.0-0.0.1 or ghcr.io/epinio/epinio-ui:latest-next
  • Enter a wrong username / password and login

Observed behavior

The user is taken to an 401 error screen and then returned to the login screen

Screencast.from.06-10-23.09.29.42.mov

Error:

xhr.js:178     GET https://epinio.192.168.16.3.omg.howdoi.website/pp/v1/direct/r/ZThhPrryoUeUuimbk4Gb-G3-I9A/api/v1/namespaces 401 (Unauthorized)

Note: CLI handles correctly the message:

Ξ epinio-repos/epinio git:(main) ▶ epinio login -u admin https://epinio.192.168.16.3.omg.howdoi.website

🚢  Login to your Epinio cluster [https://epinio.192.168.16.3.omg.howdoi.website]
Password: 

⚠️  Certificate signed by unknown authority

|     KEY     |      VALUE      |
|-------------|-----------------|
| Issuer Name | CN=epinio-ca    |
| Common Name | epinio-ca       |
| Expiry      | 2024-January-04 |

Do you want to trust it (y/n): y

✔️  Trusting certificate for address https://epinio.192.168.16.3.omg.howdoi.website...

❌  error verifying credentials: error while connecting to the Epinio server: wrong password

Expected behavior

UI should handle it correctly not redirecting the user and displaying an error in the login page as before: Invalid username or password. Please try again.

Image

Setup

Kubernetes Version: v1.25.4+k3s1
Epinio Server Version: v1.10.0-15-g47ee6f4e
Browser: Brave v1.58.135
UI Image: ghcr.io/epinio/epinio-ui:v1.10.0-0.0.1 or ghcr.io/epinio/epinio-ui:latest-next

@andreas-kupries
Copy link

andreas-kupries commented Oct 6, 2023

From a talk in slack we are theorizing that the issue is as follows:

  • We assume that the ui uses the /info endpoint after login to check if the entered credentials are correct or not.
  • Before the recent changes in the server the /info endpoint was authenticated and served that purpose well.
  • With the recent changes (#2604) the /info is not authenticated any longer.
  • To the UI this change means it comes to believe that even bad credentials are ok.
    It then goes forward with actual work (like listing the namespaces), and then fails there with the bad credentials.
    And was not prepared for that, hence the 401.

@richard-cox ^ ping

@mmartin24 mmartin24 added the kind/bug Something isn't working label Oct 9, 2023
@enrichman enrichman added this to the v1.11.0 milestone Oct 9, 2023
@enrichman enrichman transferred this issue from epinio/epinio Oct 9, 2023
@richard-cox richard-cox moved this from Icebox to Next Up in UI Oct 16, 2023
@richard-cox
Copy link
Member

@andreas-kupries you're 100% correct. we were using /info to check creds, which then always succeeded after the change (we requested) to make /info not require creds.

A PR is up now to use the new /me endpoint

@richard-cox richard-cox moved this from Next Up to Review in UI Oct 16, 2023
@richard-cox richard-cox moved this from Scheduled to In Progress in Epinio planning Oct 16, 2023
@github-project-automation github-project-automation bot moved this from Review to Done in UI Nov 3, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Epinio planning Nov 3, 2023
@richard-cox richard-cox reopened this Nov 3, 2023
@github-project-automation github-project-automation bot moved this from Done to Next Up in UI Nov 3, 2023
@richard-cox richard-cox moved this from Done to To Review in Epinio planning Nov 3, 2023
@richard-cox richard-cox moved this from Next Up to To Test in UI Nov 3, 2023
@mmartin24
Copy link
Contributor Author

Fixed issue.
CI tests previously failing passing now (ie: https://github.com/epinio/epinio-end-to-end-tests/actions/runs/6845007595)

@github-project-automation github-project-automation bot moved this from To Review to Done in Epinio planning Nov 13, 2023
@github-project-automation github-project-automation bot moved this from To Test to Done in UI Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Archived in project
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants