owncloud / owncloud/android

Change behaviour in auth method detection

Open
#4,150 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Authentication
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

After typing server URL in login view, a request to /remote.php/dav/files/

Then, check WWW-Authenticate headers in response

Current behaviour:

https://github.com/owncloud/android/blob/02a321e14a9a915a92b7c8f40afe235e48388882/owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt#L327

First, we check if is basic, if not, check if it's bearer, then OIDC...

New behaviour:

Contains Bearer ➡ OAuth 2.0 / OpenID Connect
Doesn’t contain Bearer ➡ Basic

Also, in case the WWW-Authenticate header contains any other string that's not Bearer or Basic , we should show a readable error message. Now:

OCP\Session\Exceptions\SessionNotAvailableException: Session has been closed - no further changes to the session are allowed

More context in:

TASKS
  • Research (if needed)
  • Create branch feature/feature_name
  • Development tasks
    • Implement whatever
    • ...
  • Code review and apply changes requested
  • Design test plan
  • QA
  • Merge branch feature/feature_name into master
PR
  • App
  • Library (if needed)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in owncloudApp/src/main/java/com/owncloud/android/presentation/authentication/LoginActivity.kt around line 327, where the authentication method is detected after the DAV request. Trace how the WWW-Authenticate header is handled. Done means Bearer selects OAuth 2.0/OpenID Connect, headers without Bearer select Basic, and unsupported values produce a readable error instead of the current exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
kotlin
Domain
authentication, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.