问题
I have made a chat-bot in android in which i called google dialog-flow api. In google dialog-flow, I am calling an third part api. Now i want to implement user authentication in android app but not from google account. I want to authenticate users from the third party (the one i am connecting it to dialog-flow).
How can i send authentication data while sending message from android application below code how can i add credentials ? I want to attach user credentials while sending message is it possible ?
Note : I don't want to use google account to authenticate users.
Following is the Android code :
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch (requestCode) {
case REQ_CODE_SPEECH_INPUT: {
if (resultCode == RESULT_OK && null != data) {
ArrayList<String> result = data
.getStringArrayListExtra(RecognizerIntent.EXTRA_RESULTS);
showTextView(result.get(0), USER);
//speak(result.get(0));
aiRequest.setQuery(result.get(0));
RequestTask requestTask = new RequestTask(MainActivity.this, aiDataService,
customAIServiceContext);
requestTask.execute(aiRequest);
}
break;
}
}
}
So here I am sending data from android application to dialog-flow. So here I want to attach username and password or user id to authenticate user
Thank you in Advance.
来源:https://stackoverflow.com/questions/58936205/dialogflow-sending-user-data