File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
auth0/src/main/java/com/auth0/android Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ internal class PARCodeManager(
2727 private const val KEY_CLIENT_ID = " client_id"
2828 private const val KEY_REQUEST_URI = " request_uri"
2929 private const val KEY_CODE = " code"
30+ private const val KEY_STATE = " state"
3031 private const val KEY_ERROR = " error"
3132 private const val KEY_ERROR_DESCRIPTION = " error_description"
3233 private const val ERROR_VALUE_ACCESS_DENIED = " access_denied"
@@ -81,8 +82,11 @@ internal class PARCodeManager(
8182 return true
8283 }
8384
84- // Success - return authorization code
85- val authorizationCode = AuthorizationCode (code = code)
85+ // Extract optional state
86+ val state = values[KEY_STATE ]
87+
88+ // Success - return authorization code with optional state
89+ val authorizationCode = AuthorizationCode (code = code, state = state)
8690 callback.onSuccess(authorizationCode)
8791 return true
8892 }
Original file line number Diff line number Diff line change @@ -6,11 +6,18 @@ package com.auth0.android.result
66 * handles the token exchange.
77 *
88 * @property code The authorization code from the callback
9+ * @property state The optional state parameter from the callback, if present
910 */
1011public data class AuthorizationCode (
1112 /* *
1213 * The authorization code received from Auth0.
1314 * This code should be sent to your BFF for token exchange.
1415 */
15- public val code : String
16+ public val code : String ,
17+
18+ /* *
19+ * The optional state parameter received from Auth0.
20+ * This can be used by the BFF to correlate the response with the original request.
21+ */
22+ public val state : String? = null
1623)
You can’t perform that action at this time.
0 commit comments