2
votes

Looking at the App Action slice fulfillment information around authentication. Google has these lines from https://developers.google.com/actions/appactions/slices#handling_authentication:

  • (Required) Where user authentication is needed to complete a user flow, return a Slice that explains that the user needs to continue in the app. In-line user authentication in the Assistant is not supported for App Actions.

  • If users are permitting your app to show data via Slices, you can return an Error Slice at runtime for unauthorized users.

However, I have not been able to find any referencing to where the authentication for the Assistant launched function can be found. Is this provided in the slice provider or does this get automatically handled for the account by the Assistant before calling on your application? Having a use case of providing your account information in a slice you would need to authenticate the Assistant request somehow, either something from the Assistant saying the voice is matched to an existing user on the device or matches some other kind of account information you have on device.

1

1 Answers

0
votes

App Actions has two fulfillment modes (via deep link or via Slice). In both cases, the code that runs when Assistant requests the App Action is within your application (deep link via your Activity and Slices via your SliceProvider).

This means your own code can check if the user has logged into your app or not and respond accordingly.

  • For deep link fulfillment, where one of your Activities will open up, you could redirect the user to your main login screen

  • For Slices, within your SliceProvider, you can check if the user is logged in and if not, return back a Slice that has text explaining the user needs to login via your app to see the content. Slices shown within Assistant also automatically have a "Open app" button in the footer so the user can open your app directly to login via your regular app login flow (you could also add your own link in the body of the Slice that could take the user to the login screen, up to you).

So basically, the auth checking and auth flows for App Actions happen purely within your Android app code. There are no auth flows or APIs within Assistant for App Actions at this stage which is what the docs are referring to when they say:

In-line user authentication in the Assistant is not supported for App Actions.