Bixby Capsule asks for login indefinitely - bixby

I am working on enabling Bixby Oauth2 Authorization on some actions.
I have configured the authorization.bxb as follows:
authorization {
user {
oauth2-authorization-code (PROVIDER) {
authorize-endpoint (https://X.com/authorize)
client-id (userId)
client-secret-key (password)
login-button-label(LOGIN)
token-endpoint (https://X.com/token)
}
}
}
I have declared my endpoint like:
action-endpoint (MyAuthenticatedAction) {
accepted-inputs ($vivContext)
local-endpoint (myAuthenticatedAction.js)
authorization {
user
}
}
Bixby successfully shows up popup to login and opens up X.com for authorization. After authorization a callback is done to Bixby with code and state parameters.
Bixby now sends the code received from the callback to token-endpoint. But even after getting a success response from the route (as per server logs), Bixby again shows the login popup.
The response of token-endpoint is:
{
"access_token":"XXXXXXXXXXXXXXXXXXX",
"expires_in": 3600,
"refresh_token": "XXXXXXXXXXXXXXXXXX"
}
Bixby continues to show the Login popup yet after receiving the response. Bixby debugger does not help as well.

Answering this question might require some more information about your capsule.
I'd recommend experiencing the behavior again and reaching out to the support team via the "Contact Support" option in Bixby Studio's Help dropdown menu.
This will give the Support team additional diagnostics to investigate further.

Related

How do I invoke Link Update Mode in the Plaid Sandbox Quickstart app (node.js)?

I have the Plaid Quickstart (node) up and running.
I successfully logged in to one of the sandbox institutions (First Platypus Bank) using the sandbox credentials and got the access_token which it generated.
Per the Link Update Mode docs (https://plaid.com/docs/link/update-mode/), you should be able to "force a given Item into an ITEM_LOGIN_REQUIRED state".
From the docs I linked to above...
Update mode can be tested in the Sandbox using the /sandbox/item/reset_login endpoint, which will force a given Item into an ITEM_LOGIN_REQUIRED state.
I used Postman (in the Sandbox Public environment) to send an API call to this endpoint, https://sandbox.plaid.com/sandbox/item/reset_login, to force the ITEM_LOGIN_REQUIRED state.
This is the body sent with the API call...
{
"client_id": "{{client_id}}",
"secret": "{{secret_key}}",
"client_name": "Insert Client name here",
"country_codes": ["US"],
"language": "en",
"user": {
"client_user_id": "unique_user_id"
},
"access_token": "{{access_token}}"
}
This is the response I got back...
{
"expiration": "2021-02-13T04:13:12Z",
"link_token": "link-sandbox-7d82e9b8-b8a7-4977-9c20-aadbc82ec050",
"request_id": "eE56J8f5XJKpS6L"
}
...which is what I expected.
I then went back in to the Quickstart app and logged in to the "First Platypus Bank" again expecting to be prompted for the MFA challenges, but, instead, it just created a new access_token.
So, how to I get the Plaid Quickstart app into Link Update mode?
Update:
Per Alex's question, here is an image showing the Postman call I made. He's correct, it was a /link/token/create call. What's confusing it that it's labeled Create Link Token - Update Mode.
Update 2:
Here's the /sandbox/item/reset_login call and response. There's no link_token included in the response.
Update 3:
Between Alex's help and some help from Plaid support, I got this working.
I was putting the link token in the wrong place.
For anyone seeing this in the future, here are the steps you need to follow to get the node quickstart app into Link Update Mode.
You can also watch this video to see a demo of the process; HOWEVER, note that in the video, I put the link_token in the wrong place. The instructions below show how to put it in the correct place.
Get the access_token for the institution you want to get into Link Update Mode (this assumes you have the quickstart app installed, up and running. See... https://plaid.com/docs/quickstart/)
Start the quickstart backend (/quickstart/node/start.sh)
Start the quickstart frontend (cd /quickstart/frontend; npm start;)
Once the frontend fires up on port 3000 in your browser, click the "Launch Link" button then click "Continue".
Search for the institution (e.g., First Platypus Bank, First Gingham Credit Union...if in sandbox mode. or your own institution if in dev mode)
Enter your credentials (user_good/pass_good ...if in sandbox mode)
Copy the access_token
Close the Plaid browser tab
In Postman (to set this up, see... https://github.com/plaid/plaid-postman), enter the access token you just copied into the access_token variable (See the first screenshot above. Click on the icon near the upper right-hand side that looks like an eye then scroll down to access_token and enter it.)
Run the /sandbox/item/reset_login endpoint. It's labeled "Simulate ITEM_LOGIN_REQUIRED [Sandbox only]" in Postman. The request body should look like second screenshot above. Once you Send the request, the response body should show "reset_login": true. Now the Plaid Item (i.e., the institution) is in ITEM_LOGIN_REQUIRED mode.
Run the /link/token/create endpoint. It's labeled "Create Link Token - Update Mode" in Postman. The request body should look like the first screenshot above. Once you Send the request, the response body should give you a link_token. Copy it for the next step.
Put the link_token in the Plaid quickstart app.
On line 23 in /quickstart/frontend/src/App.tsx, replace data.link_token with your link_token. So this dispatch({ type: "SET_STATE", state: { linkToken: data.link_token } }); becomes this dispatch({ type: "SET_STATE", state: { linkToken: "link-sandbox-704ef648-2acd-44a2-867b-ea1258e9205c" } }); (Use your own link_token, of course, and don't forget the quotes around your link_token.)
Restart the backend and frontend. When you launch Link, it should now be in Link Update Mode.
The process you describe sounds right, but the API request and response bodies in your post are the request and response for /link/token/create, not /sandbox/item/reset_login. Can you verify that you didn't accidentally call /link/token/create instead of calling /sandbox/item/reset_login?

How to replace default response in account linking on Google Assistant

As part of an action configured for account linking with the following topology:
Actions-on-Google->Dialogflow->Webhook,
I'm seeing Google Assistant injecting its own message prior to going through the account linking flow, as follows:
"I need to link your <action-name> to Google. Is that ok?"
The linking flow is triggered by the following in the webhook:
public ActionResponse launchRequestHandler(ActionRequest request) throws Exception {
ResponseBuilder responseBuilder = getResponseBuilder(request);
responseBuilder.add(new SignIn());
}
I'd like to be able to replace the above stock message with a custom one, however when attaching a context to a sign in card with our own message, like so:
String speech = "Hi, I see that your account isn't connected. "
+ "I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps. "
+ "Don't worry, I'll be here waiting, just call me when you're ready.";
responseBuilder.add(
new SignIn()
.setContext(speech));
I'm still seeing the default message tacked at the end:
"Hi, I see that your account isn't connected.
I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps.
Don't worry, I'll be here waiting, just call me when you're ready.,
I need to link your <action-name> to Google. Is that ok? "
How can I replace the Google default message with my own?
To ensure a consistent experience for users, you cannot replace the default message. You can only set the context, which lets you provide your custom information for the user ahead of the generic question.
The context is an additional piece of information which may be more relevant to your Action. Let's say it's connecting to your example.com account. You would add the context as a string:
app.intent('Login', conv => {
conv.ask(new SignIn('To provide you with personalized info from example.com'))
})
The user would hear this message, with the generic prompt appended:
To provide you with personalized info from example.com, I need to link your Example Action to Google. Is that ok?
Then you can say yes or no, and go through the OAuth flow / Google Sign-In flow.

Dialogflow account linking - google home

I'm having slight issues using dialogflow and the SignIn helper with google home, in the simulator it works all fine with account linking including the google home simulator, but when I reset and attempt to link it again with my physical google home that I have, it's saying the following phrase everytime I hit the sign in intent:
"Alright, no problem. Just so you know, that means you won't be able to use your account with x. If you change your mind, you can always come back and sign in then. Sorry, can you say that again?"
This phrase seems to come from when you decline to sign in.
Does anyone have any idea how to fix this? It should actually refer me to my application, on the Google Home simulator is directs me to something like this which is correct:
"To get your account details, you'll need an account with x. To get you signed in, I'll just need some info. If you want more details, say "Tell me more. " So, can I ask Google for your name, email address, and profile picture?"
Heres my intent code:
import { dialogflow, SignIn} from 'actions-on-google';
import '#babel/polyfill';
const app = dialogflow({
debug: true,
clientId: process.env.client_id,
});
app.intent('StartSignIn', conv => {
conv.ask(new SignIn('Sign in'))
});
exports.main = app
P.S does anyone know how to get the sign in status, I can't seem to get it via (conv, params, signin) handler of the intent.
Many thanks!
I replicated your scenario and found a similar issue. Google Assistant went unresponsive after initiating the sign-in intent from my phone. The simulator worked fine for phone and speaker devices. I think it might not be available yet. You can give it a try with a deployed version.
Regarding the (conv, params, signin), be sure to add the actions_intent_SIGN_IN to the intent you want to be detected when the sign-in flow finishes.
After that, you can access the status, like this:
app.intent('signInConfirm', (conv, params, signin) => {
conv.close(`Sign in status: ${signin.status}`);
});

Facebook graph API - i recieve the error "Missing authorization code"?

i am new to the facebook api and i came across a weird issue and i cannot really find a solution for it. i am trying to get an access token using the following instructions :
but when i try to do :
curl -X GET "https://graph.facebook.com/oauth/access_token?client_id=[ID]&client_secret=[SECRET]&redirect_uri=http://localhost&grant-type=clients_credentials"
it fails even when i do it in my code , it also fails:
var firstOptions = {
method: 'GET',
url: 'https://graph.facebook.com/oauth/access_token?client_id=[ID]&client_secret=[SECRET]&grant-type=client_credentials&redirect_uri=http://localhost',
json: true,
};
request(firstOptions, function (error, response, body) {
console.log(body);
});
so i was wondering if someone could tell me where and how i get the authorization code ? or if i am doing something wrong. because the facebook image isn't including any authorization code..
EDIT:
after a suggestion i tried the following :
var pageOptions={
method: 'GET',
url: 'https://graph.facebook.com/[PAGE-ID]/posts?access_token=' + 'ID|SECRET',
json:true
};
but then i got the follow error:
{ message: '(#10) To use \'Page Public Content Access\', your use of this endpoint must be reviewed and approved by Facebook. To submit this \'Page Public Content Access\' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.',
this error does not occure when i use an access_token generated by the Access Token Debugger:
https://developers.facebook.com/tools/debug/accesstoken/
{ message: '(#10) To use \'Page Public Content Access\', your use of this endpoint must be reviewed and approved by Facebook. To submit this \'Page Public Content Access\' feature for review please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.',
this error does not occure when i use an access_token generated by the Access Token Debugger
You are simply using the wrong kind of access token here.
To access content of just any arbitrary public page, your app would need to be reviewed by Facebook first.
It works with the token you generated in the debug tool, because that is a user token and you have an admin role on the page in question - which means this is not general access to just “public” data any more, but to content you actually have admin access to. With an app access token, the API has no way of checking for that.
You need to use a page admin user token, or a page token for this kind of request.

Posting on facebook via unificationengine

Hi I'd like to post to facebook via unification engine. I've already created a user, added and tested successfully a facebook connection, but when I post I get the following response:
{"Status":{"facebook":{"status":190,"info":"Error validating access token: Session does not match current stored session. This may be because the user changed the password since the time the session was created or Facebook has changed the session for security reasons.: "}},"URIs":[]}
When I use the facebook token, that was used for creating the connection, to post to facebook directly (without unificationengine), then it works just fine. What might be the problem here? Status 190 is neither documented on facebook nor on unificationengine.
#unificatinengine developers: it would be practical, if the errors returned by the service would be passed on inside the unificationengine response, this way debugging such errors would be easier, and the errors could also be processed programmatically.
Additional info
Today I seem not to be able to reproduce the response of yesterday. The postfields I use to post the message to facebook (the same as yesterday) are as follows:
{
"message":{
"receivers":[
{
"name":"me",
"address":"https://graph.facebook.com/v2.1/me/feed",
"Connector":"facebook"
}
],
"sender":{
"address":"sender address"
},
"subject":"test",
"parts":[
{
"id":"0",
"contentType":"text/plain",
"type":"body",
"size":25,
"data":"this is the plain message"
},
{
"id":"1",
"contentType":"text/html",
"type":"body",
"size":42,
"data":"<div>this is the <b>html</b> message</div>"
},
{
"id":"2",
"contentType":"text/plain",
"type":"link",
"size":17,
"data":"http://www.web.de"
},
{
"id":"3",
"contentType":"text/plain",
"type":"link_description",
"size":21,
"data":"some link description"
},
{
"id":"4",
"contentType":"text/plain",
"type":"link_title",
"size":10,
"data":"link title"
}
]
}
}
But today I get the following message back from unificationengine
{
"Status":{
"facebook":{
"status":100,
"info":"Unsupported post request. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api: "
}
},
"URIs":[]
}
Unfortunately this does not tell me, what unificationengine does internally for posting to facebook (which should not concern me), and what goes wrong there.
Does the "/v2/connection/info" show the details of the facebook connection that you have added? If not can you please update the connection with a new access token, using the same connection identifier for the "v2/connection/add" api endpoint, and check if it works.
unificationengine

Resources