in facebook-common/src/main/java/com/facebook/login/WebLoginMethodHandler.kt [85:139]
protected open fun addExtraParameters(parameters: Bundle, request: LoginClient.Request): Bundle {
parameters.putString(ServerProtocol.DIALOG_PARAM_REDIRECT_URI, getRedirectUrl())
if (request.isInstagramLogin) {
parameters.putString(ServerProtocol.DIALOG_PARAM_APP_ID, request.applicationId)
} else {
// Client id is a legacy name. IG Login doesn't support it. This line is kept
// for FB Login for consistency with old SDKs
parameters.putString(ServerProtocol.DIALOG_PARAM_CLIENT_ID, request.applicationId)
}
parameters.putString(ServerProtocol.DIALOG_PARAM_E2E, LoginClient.getE2E())
if (request.isInstagramLogin) {
parameters.putString(
ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE,
ServerProtocol.DIALOG_RESPONSE_TYPE_TOKEN_AND_SCOPES)
} else {
if (request.permissions.contains(LoginConfiguration.OPENID)) {
parameters.putString(ServerProtocol.DIALOG_PARAM_NONCE, request.nonce)
}
parameters.putString(
ServerProtocol.DIALOG_PARAM_RESPONSE_TYPE,
ServerProtocol.DIALOG_RESPONSE_TYPE_ID_TOKEN_AND_SIGNED_REQUEST)
}
// PKCE params
parameters.putString(ServerProtocol.DIALOG_PARAM_CODE_CHALLENGE, request.codeChallenge)
parameters.putString(
ServerProtocol.DIALOG_PARAM_CODE_CHALLENGE_METHOD, request.codeChallengeMethod?.name)
parameters.putString(
ServerProtocol.DIALOG_PARAM_RETURN_SCOPES, ServerProtocol.DIALOG_RETURN_SCOPES_TRUE)
parameters.putString(ServerProtocol.DIALOG_PARAM_AUTH_TYPE, request.authType)
parameters.putString(ServerProtocol.DIALOG_PARAM_LOGIN_BEHAVIOR, request.loginBehavior.name)
parameters.putString(ServerProtocol.DIALOG_PARAM_SDK_VERSION, "android-${getSdkVersion()}")
if (getSSODevice() != null) {
parameters.putString(ServerProtocol.DIALOG_PARAM_SSO_DEVICE, getSSODevice())
}
parameters.putString(
ServerProtocol.DIALOG_PARAM_CUSTOM_TABS_PREFETCHING,
if (FacebookSdk.hasCustomTabsPrefetching) "1" else "0")
if (request.isFamilyLogin) {
parameters.putString(ServerProtocol.DIALOG_PARAM_FX_APP, request.loginTargetApp.toString())
}
if (request.shouldSkipAccountDeduplication()) {
parameters.putString(ServerProtocol.DIALOG_PARAM_SKIP_DEDUPE, "true")
}
// Set Login Connect parameters if they are present
if (request.messengerPageId != null) {
parameters.putString(ServerProtocol.DIALOG_PARAM_MESSENGER_PAGE_ID, request.messengerPageId)
parameters.putString(
ServerProtocol.DIALOG_PARAM_RESET_MESSENGER_STATE,
if (request.resetMessengerState) "1" else "0")
}
return parameters
}