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

OAuth Client Redirect URL doesn't accept url's containing '_'. #8868

Closed
4 tasks done
guilhermenovais opened this issue May 8, 2024 · 4 comments
Closed
4 tasks done

Comments

@guilhermenovais
Copy link

Support guidelines

I've found a bug and checked that ...

Description

When trying to register an OAuth Client using an URL containing '_', the server responds with 422. There is no error displayed on the screen. The following error is printed to console.
image

Debug information

Debug information generated at 2024-05-08 14:23:58 for Firefly III version v6.1.15.

System information
ItemValue
Firefly III6.1.15 / v2.0.14 / 24 (exp. 24)
PHP version8.3.6 (64bits) / apache2handler / Linux x86_64
BCscale12
Error reportingDisplay: Off, reporting: ALL errors
Max upload67108864 (64 MB)
Database drivers*mysql*, pgsql, sqlite,
Docker build#1074, base #83
Firefly III information
ItemValue
TimezoneAmerica/Sao_Paulo + America/Sao_Paulo
App environmentlocal, debug: false
Layoutv1
Loggingnotice, stack / (empty)
Cache driverfile
Default language and localeen_US + equal
Trusted proxies*
Login provider & user guardeloquent / web
Login headersN/A + N/A
Stateful domains
Last cron jobnever (never)
Mailerlog
User-specific information
ItemValue
User#1 of 1
User flags
Session start2024-05-01 00:00:00
Session end2024-05-31 23:59:59
View range1M
User languageen_US
User localeen_US
Locale(s) supporteden_US.utf8: ✅
en_US.UTF-8: ✅
User agentMozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0

Expected behaviour

No response

Steps to reproduce

  1. Open the Create Client dialog on OAuth screen;
  2. Enter a URL containing the underscore character;
  3. Click the Create button.

Additional info

No response

@JC5
Copy link
Member

JC5 commented May 8, 2024

I can't replicate this. It works fine for me, and it works fine on the demo site as well.

Can you see what the 422 contains, exactly?

@guilhermenovais
Copy link
Author

Here are the request and the response. I forgot to mention that Firefly is running behind a reverse proxy.

Raw Request

POST /oauth/clients HTTP/2
Host: firefly.test.com
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0
Accept: application/json, text/plain, /
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/json
X-Requested-With: XMLHttpRequest
X-CSRF-TOKEN: x-csrf-token
X-XSRF-TOKEN: x-xsrf-token
Content-Length: 98
Origin: https://firefly.test.com
DNT: 1
Connection: keep-alive
Cookie: google2fa_token=2fatoken; XSRF-TOKEN=token; laravel_token=laraveltoken
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: same-origin
Pragma: no-cache
Cache-Control: no-cache
TE: trailers

{"errors":[],"name":"importer","redirect":"http://firefly_importer.test.com","confidential":false}

Raw Response

HTTP/2 422
server: openresty
date: Wed, 08 May 2024 17:51:35 GMT
content-type: application/json
cache-control: no-cache, private
x-frame-options: deny
content-security-policy: default-src 'none'; object-src 'none'; script-src 'unsafe-eval' 'strict-dynamic' 'nonce-Q6Ops0pwMJSLOV7wgu2iNw=='; style-src 'unsafe-inline' 'self'; base-uri 'self'; font-src 'self' data:; connect-src 'self' ; img-src 'self' data: 'nonce-Q6Ops0pwMJSLOV7wgu2iNw==' ; manifest-src 'self'; form-action 'self'
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
referrer-policy: no-referrer
x-permitted-cross-domain-policies: none
x-robots-tag: none
feature-policy: geolocation 'none'; midi 'none'; sync-xhr 'self'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; fullscreen 'self'; payment 'none'
set-cookie: XSRF-TOKEN=token; expires=Wed, 08 May 2024 19:51:35 GMT; Max-Age=7200; path=/; samesite=lax
set-cookie: firefly_session=session; path=/; httponly; samesite=lax
X-Firefox-Spdy: h2

@JC5
Copy link
Member

JC5 commented May 8, 2024

Host names with an underscore in them are not valid as per RFC 1123. So it may work here and there but your mileage may vary.

Try a dash instead of a underscore.

@JC5 JC5 closed this as completed May 18, 2024
Copy link
Contributor

Hi there! This is an automatic reply. Share and enjoy

This issue is now 🔒 closed. Please be aware that closed issues are not monitored by the developer of Firefly III.

  • If the original bug is not actually fixed, please open a new issue. Refer to this issue for clarity.
  • Follow-up questions must be posted in a new discussion
  • Further replies to this issue may get no response.

If there is more to discuss, please open a new issue or discussion.

Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants