Skip to content

Commit

Permalink
Added login_hint parameter to login request URL
Browse files Browse the repository at this point in the history
  • Loading branch information
JuancaG05 committed Jan 22, 2024
1 parent f950a77 commit bcf79fd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* ownCloud Android client application
*
* @author David González Verdugo
* Copyright (C) 2020 ownCloud GmbH
* @author Juan Carlos Garrote Gascón
*
* Copyright (C) 2024 ownCloud GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand All @@ -27,12 +29,13 @@ import com.owncloud.android.R
import com.owncloud.android.data.authentication.QUERY_PARAMETER_CLIENT_ID
import com.owncloud.android.data.authentication.QUERY_PARAMETER_CODE_CHALLENGE
import com.owncloud.android.data.authentication.QUERY_PARAMETER_CODE_CHALLENGE_METHOD
import com.owncloud.android.data.authentication.QUERY_PARAMETER_LOGIN_HINT
import com.owncloud.android.data.authentication.QUERY_PARAMETER_PROMPT
import com.owncloud.android.data.authentication.QUERY_PARAMETER_REDIRECT_URI
import com.owncloud.android.data.authentication.QUERY_PARAMETER_RESPONSE_TYPE
import com.owncloud.android.data.authentication.QUERY_PARAMETER_SCOPE
import com.owncloud.android.data.authentication.QUERY_PARAMETER_STATE
import com.owncloud.android.data.authentication.QUERY_PARAMETER_USERNAME
import com.owncloud.android.data.authentication.QUERY_PARAMETER_USER
import com.owncloud.android.domain.authentication.oauth.model.ClientRegistrationRequest
import java.net.URLEncoder
import java.security.MessageDigest
Expand Down Expand Up @@ -113,7 +116,10 @@ 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()) appendQueryParameter(QUERY_PARAMETER_USERNAME, username)
if (!username.isNullOrEmpty()) {
appendQueryParameter(QUERY_PARAMETER_USER, username)
appendQueryParameter(QUERY_PARAMETER_LOGIN_HINT, username)
}
}.build()

fun buildRedirectUri(context: Context): Uri =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
* ownCloud Android client application
*
* @author David González Verdugo
* Copyright (C) 2020 ownCloud GmbH.
* @author Juan Carlos Garrote Gascón
*
* Copyright (C) 2024 ownCloud GmbH.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
Expand Down Expand Up @@ -58,4 +60,5 @@ const val QUERY_PARAMETER_PROMPT = "prompt"
const val QUERY_PARAMETER_CODE_CHALLENGE = "code_challenge"
const val QUERY_PARAMETER_CODE_CHALLENGE_METHOD = "code_challenge_method"
const val QUERY_PARAMETER_STATE = "state"
const val QUERY_PARAMETER_USERNAME = "user"
const val QUERY_PARAMETER_USER = "user"
const val QUERY_PARAMETER_LOGIN_HINT = "login_hint"

0 comments on commit bcf79fd

Please sign in to comment.