Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 650f348

Browse files
authored
Merge pull request #419 from owncloud/improvement/oauth2_pkce
Add PKCE support
2 parents 593da77 + 2007077 commit 650f348

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

owncloudComLibrary/src/main/java/com/owncloud/android/lib/common/http/HttpConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public class HttpConstants {
5656
public static final String OAUTH_HEADER_GRANT_TYPE = "grant_type";
5757
public static final String OAUTH_HEADER_REDIRECT_URI = "redirect_uri";
5858
public static final String OAUTH_HEADER_REFRESH_TOKEN = "refresh_token";
59+
public static final String OAUTH_HEADER_CODE_VERIFIER = "code_verifier";
5960

6061
/***********************************************************************************************************
6162
************************************************ CONTENT TYPES ********************************************

owncloudComLibrary/src/main/java/com/owncloud/android/lib/resources/oauth/params/TokenRequestParams.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,16 @@ sealed class TokenRequestParams(
3939
clientAuth: String,
4040
grantType: String,
4141
val authorizationCode: String,
42-
val redirectUri: String
42+
val redirectUri: String,
43+
val codeVerifier: String,
4344
) : TokenRequestParams(tokenEndpoint, clientAuth, grantType) {
4445

4546
override fun toRequestBody(): RequestBody =
4647
FormBody.Builder()
4748
.add(HttpConstants.OAUTH_HEADER_AUTHORIZATION_CODE, authorizationCode)
4849
.add(HttpConstants.OAUTH_HEADER_GRANT_TYPE, grantType)
4950
.add(HttpConstants.OAUTH_HEADER_REDIRECT_URI, redirectUri)
51+
.add(HttpConstants.OAUTH_HEADER_CODE_VERIFIER, codeVerifier)
5052
.build()
5153
}
5254

0 commit comments

Comments
 (0)