Types of authentication > By type of app

When you start learning about Dialogflow's REST API, pretty much all the documentation usually points to this page, which is titled, using [unintelligible 00:00:10] to access Google APIs. It's considered to be like the starting point for you to work with the REST API. In fact, most of the documentation that you see will make an assumption that you have actually gone through this- I guess you can say this one page document you have here, this web page, before you move onto the other steps in your integration.

As it happens, you might be tempted to skip what looks like sort of a theoretical introduction to the authentication system. You shouldn't do that, because this part is quite important. I'm just going to go over whatever is already on the page for now, and then we'll take a look into each of these in future videos. The first thing you see is that they're talking about five scenarios. They're talking about five scenarios in which you can use the REST API. The first one is for web server applications. These are the cases where you have a website which is going to let people log into their Dialogflow account.

You might have seen similar apps, for example, if you were to use some online service, which lets you save your file to your Google Drive account, you will first have to authenticate with your Google Drive account and you have to say, "Yes. I give permission to this app to access my Google Drive," before you're actually allowed to save your file to your Google drive. That's a good example of these web server applications.

The next one is installed applications. These are talking about apps like Android apps. If you want to, let's say, integrate a Dialogflow agent into your Android app, and have a voice-based interface to the functionality you already have in your app, then you would be using the REST API with what is called an installed application. Then you can also have client side applications. These are just applications that run in a browser. A good example of this would be, let's say that you embed some JavaScript snippet into your website. A good example I can think of is, for most people, they would like to add Google Analytics to their website.

What they usually do is they just go and put some JavaScript code into the body of the HTML page. What is happening there is-- I don't want to talk about the authentication and all that at this point. It's got like a user ID specific to your Google Analytics account. You'll actually see that in the JavaScript code. When a user comes and they visits your site and interacts with your website pages and so on, it is going to record their action and use the ID that is embedded in the JavaScript code to send that information over to Google servers so that later on you go and log into your Google Analytics account, and you'll be able to see what people are doing on your site.

The link between your account and what the people are doing on your site, it happens to be that user ID thingy that you embedded in that JavaScript code. It was part of the JavaScript code that you placed inside your web page. The other example they have here is applications on limited input devices such as game consoles, video cameras and so on. I'm not going to go over that. That is not much of our concern in this particular case, maybe it is for some people, but it is not the focus for this course.

Finally, we come to the service accounts. Service accounts are useful for what they call a server to server interactions, where you're going to have some code which is running on behalf of the agent that you have already created in Dialogflow. If that was not very clear, that's okay. We'll be going over this in some detail later on.

The important thing here is that, in the case of the service account, you will have a different kind of process for the authentication. Again, we will be going into some details about that also in a future video. You'll also notice that most of the cases where the Dialogflow-- In most of the documentation for the REST API in Dialogflow, it always talks about the service account. It's not talking about the other kind of scenarios.

That actually makes a lot of sense and you'll see why very soon. With that said, these are the five types of scenarios where you might want to be integrating your Dialogflow agent and where the REST API will be helpful. We will be taking a closer look at these in future videos.