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

Stuck on "Redirecting" when using an email address as the username #2435

Closed
mdusher opened this issue Aug 25, 2021 · 5 comments
Closed

Stuck on "Redirecting" when using an email address as the username #2435

mdusher opened this issue Aug 25, 2021 · 5 comments
Labels

Comments

@mdusher
Copy link

mdusher commented Aug 25, 2021

Describe the bug

When you add a user that has an email address as the "preferred name", you will become stuck on the "Redirecting" page after login as the request to /ocs/v1.php/v1.php/cloud/users/<username>/groups fails with a 401 Unauthorized.

It appears that the request fails due to the @ in the username being URL encoded as %40 as if you replace the %40 with @ and re-run the request it succeeds as expected.

image

Steps to reproduce

Steps to reproduce the behavior:

  1. Start OCIS with ocis server
  2. Add a new username where the preferred name is an email address (eg. ocis accounts add --username michael@example.org --password test123 --preferred-name michael@example.org --mail michael@example.org --displayname Michael --enabled)
  3. Go to your OCIS instance and login as michael@example.org with the password test123

Expected behavior

The user is able to login and use OCIS

Actual behavior

The user is able to login but becomes stuck on the "Redirecting" page.

Setup

Started with:

docker pull owncloud/ocis
docker run --rm -ti -p 9200:9200 owncloud/ocis

OCIS Version:

/var/tmp/ocis $ ocis --version
ocis version a150e5f6

@jvillafanez
Copy link
Member

The problem seems to be in https://github.com/owncloud/ocis/blob/v1.11.0/ocs/pkg/middleware/requireselforadmin.go#L46
The URLParam function returns a "ab%40example.org" userid which doesn't match the username "ab@example.org". This is what causes the 401 error.

This seems to be an issue in go-chi (go-chi/chi#642). Taking this into account and that there are multiple places where we're using this URLParam function, I'm not sure if we should try to implement a middleware to adjust the parameters ourselves.
The alternative is to patch all the appearances in order to decode the values properly or provide a function ourselves in case they fix the issue.

@wkloucek
Copy link
Contributor

wkloucek commented Oct 4, 2021

@mdusher this was fixed in cs3org/reva#2076.

Could you please try again with at least oCIS 1.12.0?

@wkloucek
Copy link
Contributor

wkloucek commented Oct 4, 2021

Please reopen if you still have problems with it.

@wkloucek wkloucek closed this as completed Oct 4, 2021
@mdusher
Copy link
Author

mdusher commented Oct 4, 2021

Hi @wkloucek,

I just gave it a go using the owncloud/ocis:1.12 docker image and it's still giving me the same problem

What I did to test:

[mdu@bero ~]$ docker run -ti --rm -p 9200:9200 --name ocis --entrypoint sh owncloud/ocis:1.12
/var/tmp/ocis $ ocis --help | grep -A1 VERSION
VERSION:
   1.12.0

/var/tmp/ocis $ ocis server &
/var/tmp/ocis $ ocis accounts add --username michael@example.org --password test123 --preferred-name michael@example.org --mail michael@example.org --displayname Michael --enabled

And I'm still getting a 401 one from the groups endpoint:
image

@wkloucek wkloucek reopened this Oct 5, 2021
@wkloucek
Copy link
Contributor

wkloucek commented Oct 5, 2021

Thanks for reproducing. Sorry there was some confusion on my side. It is not fixed in oCIS 1.12.0 but will be in the upcoming oCIS 1.13.0 since cs3org/reva#2076 was merged after the release of oCIS 1.12.0. It is already working on latest master.

Logging in with michael@example.org works when starting oCIS like docker run -ti --rm -p 9200:9200 --name ocis --entrypoint sh owncloud/ocis:latest.

We expect oCIS 1.13.0 to be released by the end of the week.

@wkloucek wkloucek closed this as completed Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants