owncloud / oauth2

🔐 Application for using OAuth 2.0 in ownCloud
GNU Affero General Public License v3.0
32 stars 24 forks source link

Allow redirect_uri's like "x-cyberduck-action:oauth" #364

Closed michaelstingl closed 10 months ago

michaelstingl commented 10 months ago

Cyberduck & Mountain Duck now support WebDAV with OAuth 2.0 / OpenID Connect:

Connection Profile:

Sadly, redirect_uri's like x-cyberduck-action:oauth or x-mountainduck-action:oauth can't be added to OAuth2 0.6.1 settings on ownCloud 10.13.2

Steps to reproduce

  1. Enable OAuth2 0.6.1
  2. Login as admin user and go to /settings/admin?sectionid=authentication
  3. Add Client with redirect_uri=x-cyberduck-action:oauth

Expected behaviour

I should be able to create a new client with redirect_uri=x-cyberduck-action:oauth

Actual behaviour

Error message: Redirect URI must be a valid URL

Server configuration

{
  "installed": true,
  "maintenance": false,
  "needsDbUpgrade": false,
  "version": "10.13.2.3",
  "versionstring": "10.13.2",
  "edition": "Enterprise",
  "productname": "ownCloud",
  "product": "ownCloud"
}

CleanShot 2023-11-02 at 19 05 13@2x

@DeepDiver1975

/cc @dkocher FYI

michaelstingl commented 10 months ago

Same with occ oauth2 command:

root@owncloud:~/server# docker-compose exec owncloud occ oauth2:add-client Cyberduck 3keLfua0olYvW1zKXTDB3OjAMPEYWEQNuiscli395GKJOiPnPURNQWGvGCJZf4Hw yoqICbLIeYbpZPqDH4D8k4NKb04HqnrWBntEeVZEQ5gO1RmaUlln0Aqu1dj2UoF4 x-cyberduck-action:oauth

In AddClient.php line 111:

  The redirect URL is not valid.  

oauth2:add-client <name> <client-id> <client-secret> <redirect-url> [<allow-sub-domains> [<trusted> [<force-trust>]]]
michaelstingl commented 10 months ago

I just found, x-cyberduck-action://oauth can be added and Cyberduck works with it:

  - Cyberduck:
    - name: Cyberduck
    - redirect-url: x-cyberduck-action://oauth
    - client-id: 3keLfua0olYvW1zKXTDB3OjAMPEYWEQNuiscli395GKJOiPnPURNQWGvGCJZf4Hw
    - client-secret: yoqICbLIeYbpZPqDH4D8k4NKb04HqnrWBntEeVZEQ5gO1RmaUlln0Aqu1dj2UoF4
    - allow-sub-domains: false
    - trusted: false