Skip to content

Commit

Permalink
New brandable parameter to indicate whether sending or not `login_hin…
Browse files Browse the repository at this point in the history
…t` and `user` parameters in login request URL
  • Loading branch information
JuancaG05 committed Jan 22, 2024
1 parent bcf79fd commit c5e8b5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ class LoginActivity : AppCompatActivity(), SslUntrustedCertDialog.OnSslUntrusted
codeChallenge = authenticationViewModel.codeChallenge,
state = authenticationViewModel.oidcState,
username = username,
sendLoginHintAndUser = resources.getBoolean(R.bool.send_login_hint_and_user),
)

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ class OAuthUtils {
prompt: String,
codeChallenge: String,
state: String,
username: String?
username: String?,
sendLoginHintAndUser: Boolean,
): Uri =
authorizationEndpoint.buildUpon().apply {
appendQueryParameter(QUERY_PARAMETER_REDIRECT_URI, redirectUri)
Expand All @@ -116,7 +117,7 @@ class OAuthUtils {
appendQueryParameter(QUERY_PARAMETER_CODE_CHALLENGE, codeChallenge)
appendQueryParameter(QUERY_PARAMETER_CODE_CHALLENGE_METHOD, CODE_CHALLENGE_METHOD)
appendQueryParameter(QUERY_PARAMETER_STATE, state)
if (!username.isNullOrEmpty()) {
if (sendLoginHintAndUser && !username.isNullOrEmpty()) {
appendQueryParameter(QUERY_PARAMETER_USER, username)
appendQueryParameter(QUERY_PARAMETER_LOGIN_HINT, username)
}
Expand Down
3 changes: 3 additions & 0 deletions owncloudApp/src/main/res/values/setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,7 @@
<!-- Redact authorization header info in logs -->
<bool name="redact_auth_header_logs">true</bool>

<!-- Send login_hint and user parameters in login request -->
<bool name="send_login_hint_and_user">true</bool>

</resources>

0 comments on commit c5e8b5a

Please sign in to comment.