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

Creating user with username L. Kiesow fails #776

Open
lkiesow opened this issue Jul 1, 2024 · 2 comments
Open

Creating user with username L. Kiesow fails #776

lkiesow opened this issue Jul 1, 2024 · 2 comments
Labels
type:bug Something isn't working

Comments

@lkiesow
Copy link
Member

lkiesow commented Jul 1, 2024

Looks like the URLs are not encoded properly:

Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 39: http://localhost:8080/admin-ng/users/L. Kiesow.json                                                                                                     
        at java.net.URI.create(URI.java:883) ~[?:?]                                                                                                                                                                                           
        at org.opencastproject.util.UrlSupport.uri(UrlSupport.java:174) ~[?:?]                                                                                                                                                                
        at org.opencastproject.adminui.endpoint.UsersEndpoint.createUser(UsersEndpoint.java:360) ~[?:?]
@lkiesow lkiesow added the type:bug Something isn't working label Jul 1, 2024
@dennis531
Copy link
Contributor

dennis531 commented Jul 2, 2024

The post request parameters to /admin-ng/users look good:

{
	"username": "test1+test1",
	"name": "Test+2",
	"email": "[email protected]",
	"password": "123",
	"roles": "[]"
}

This seems like an Opencast bug as the parameter will be created by the URLSearchParams class which already encodes the values. Encoding the username with encodeURIComponent leads to the following problem:

image

In this case, I need to login with the username Test%20Test.

@mtneug
Copy link
Member

mtneug commented Jul 2, 2024

Do we want usernames with whitespaces? Are people doing this 😱?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants