diff --git a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/OAuthPrompt.java b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/OAuthPrompt.java index fc90c5765..c2fb156bd 100644 --- a/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/OAuthPrompt.java +++ b/libraries/bot-dialogs/src/main/java/com/microsoft/bot/dialogs/prompts/OAuthPrompt.java @@ -266,7 +266,7 @@ public static CompletableFuture> recognize Object tokenResponseObject = turnContext.getActivity().getValue(); TokenResponse token = null; if (tokenResponseObject != null) { - token = (TokenResponse) tokenResponseObject; + token = Serialization.getAs(tokenResponseObject, TokenResponse.class); } result.setSucceeded(true); result.setValue(token);