mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Support refresh token with own idP
This commit is contained in:
		
							parent
							
								
									44967be4e3
								
							
						
					
					
						commit
						d683da3602
					
				| @ -56,6 +56,7 @@ public class HttpConstants { | ||||
|     public static final String HEADER_GRANT_TYPE = "grant_type"; | ||||
|     public static final String HEADER_REDIRECT_URI = "redirect_uri"; | ||||
|     public static final String HEADER_CODE_VERIFIER = "code_verifier"; | ||||
|     public static final String HEADER_REFRESH_TOKEN = "refresh_token"; | ||||
| 
 | ||||
|     /*********************************************************************************************************** | ||||
|      ************************************************ CONTENT TYPES ******************************************** | ||||
|  | ||||
| @ -32,6 +32,7 @@ import com.owncloud.android.lib.common.http.HttpConstants.HEADER_AUTHORIZATION_C | ||||
| import com.owncloud.android.lib.common.http.HttpConstants.HEADER_CODE_VERIFIER | ||||
| import com.owncloud.android.lib.common.http.HttpConstants.HEADER_GRANT_TYPE | ||||
| import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REDIRECT_URI | ||||
| import com.owncloud.android.lib.common.http.HttpConstants.HEADER_REFRESH_TOKEN | ||||
| import com.owncloud.android.lib.common.http.HttpConstants.HTTP_OK | ||||
| import com.owncloud.android.lib.common.http.methods.nonwebdav.PostMethod | ||||
| import com.owncloud.android.lib.common.operations.RemoteOperation | ||||
| @ -46,7 +47,7 @@ import timber.log.Timber | ||||
| import java.net.URL | ||||
| 
 | ||||
| /** | ||||
|  * Get OIDC Discovery | ||||
|  * Perform token request | ||||
|  * | ||||
|  * @author Abel García de Prada | ||||
|  */ | ||||
| @ -67,6 +68,7 @@ class TokenRequestRemoteOperation( | ||||
|                 .add(HEADER_GRANT_TYPE, tokenRequestParams.grantType) | ||||
|                 .add(HEADER_REDIRECT_URI, tokenRequestParams.redirectUri) | ||||
|                 .add(HEADER_CODE_VERIFIER, tokenRequestParams.codeVerifier) | ||||
|                 .add(HEADER_REFRESH_TOKEN, tokenRequestParams.refreshToken.orEmpty()) | ||||
|                 .build() | ||||
| 
 | ||||
|             val postMethod = PostMethod(URL(uriBuilder.toString()), requestBody) | ||||
|  | ||||
| @ -28,6 +28,7 @@ class TokenRequestParams( | ||||
|     val authorizationCode: String, | ||||
|     val grantType: String, | ||||
|     val redirectUri: String, | ||||
|     val refreshToken: String? = null, | ||||
|     val codeVerifier: String, | ||||
|     val clientAuth: String | ||||
| ) | ||||
|  | ||||
| @ -34,7 +34,7 @@ data class TokenResponse( | ||||
|     @Json(name = "expires_in") | ||||
|     val expiresIn: Int, | ||||
|     @Json(name = "refresh_token") | ||||
|     val refreshToken: String, | ||||
|     val refreshToken: String?, | ||||
|     @Json(name = "token_type") | ||||
|     val tokenType: String, | ||||
|     @Json(name = "user_id") | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user