#3. OAuth 2.0 | Generate Client ID & Client Secret For Google APIs |

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so I've already explained the terminologies used in OS 2.0 like voltage over 2.0 authorization flow and the voltage access token what is refresh token what it authorization Grant you can see I've explained already whatever the rows are involved in this authorizing flow if not watched my previous two videos please go and watch generally you can understand the next videos so we have already covered the theories now we'll do some practicals I am going to use show you how can we use the Google Drive apis and Gmail apis but why would you need that apis suppose if you go to Google Drives like something called personal cloud storage you can upload some files or folders here and you can access it anywhere let me sign in so make sure that you should have Google account the same account which whatever you create for your to access the Gmail Sims you can use because once you create the account on Google you can access so many services provided by them like Google type Gmail everything you can use so make sure you should have Google account if you don't have then you can create here maybe you can click on use another account and like click on the create account so I have already created one so let me go to automation report by Amazon I've created this a Google account before making this video tool it will login with this okay so this is my Google Drive and I uploaded some files okay so if you want to upload some files so maybe you need to go to new and you can up some select some file or folders from your desktop but suppose if you're creating any application or creating some automation framework where you want to upload your automation report to a shared drive so that anyone can access that and they can view the report or they can view the result so obviously one way you have like you go take the report and upload manually through here or you write some code so that automatically it will go and upload the files in Google Drive for you so one way you have you can you can download the Google client libraries and you can add into your project and you can use that classes and interfaces or you can use the apis to do that one so let me show you here if you go go to Google Drive API so go to introduction.google drive API and if you go here you see the manage files and folders you can see like create files you can upload a file data let me go to upload file data you can see that the Google Drive API let you upload file data when you create a data file means you can use some apis right you can see it is post API and you can use this API to upload the file to Google Drive so now the first step before we use any Google Drive API or Gmail API first we need to register with Google as a client so that I should have my client ID and client secret we don't have any real-time app but for the testing purpose we'll create some dummy app and then I will get my client ID and client Circuit by resting with Google so but before that you need to go and read the documentation actually because accessing the API is not a big deal but how you do that how you get the authentication what are the steps you need to understand that thing that is the important thing here I am going to show you all the steps by reading their official document communication because if you watch my videos after one year maybe this video option will not be the same you you might see some different options you should know that where you need to go and find the steps correct steps so for that simply you need to go to this one where I open the Google Drive API but before that go to overview okay start from the overview you need to read this you need to understand you need to go to home if you go to home you can see all those gmails Google services like Google Calendar Google Chat classroom talks Drive keep made sheets means you can use whatever a page you want to use and for all those services or apis you need to use a similar step so for that you need to go to guide so you have actually five steps to get started create a Google Cloud project enable the AP you want to use learn our authentication authorization Works configure over consent create access credentials so first thing you see create a Google Cloud project click on this I will suggest go and read then only you understand the small small terms you can see the simple thing to create a Google Cloud project in the Google Cloud console go to menu and it gave some option it is giving one link also or let me copy the link address so let me go and open in the browser which URL opens so since I have already added some accounts it is showing me this screen but you don't have any account added then it will ask you to enter your Google Account Details if you don't have again go and create it so let me use another account which I've created okay so if your first time you log in it will ask you what is your country so it is automatic taking Android States let me go to check boxes terms of services and click again continue so here we have logged in into Google Cloud project now you can see here it is asking you to go to Google Cloud console go to menu I am admin and create a project means it is asking you to go to this menu and here okay already it's showing so I am admin and here you see create a project okay you can click on this why I am following the exit step here because this will be updated all the time my YouTube videos might be updated after one year so you need to go to this documentation and get the updated that's why I'm referring from here so you need to provide the project name and some location so let me go here and itself explanatory here you can give some project name here give the name like and I don't want to pass any location here so simply click on the create it will take some time to configure everything okay so we can see some dashboard here we can see my project name project name number project ID we can see everything here so first step we are done now you can see Next Step automatically here click on this here you can see that before using Google API you need to turn them on in Google Cloud project means when to use Google Drive API is going to use the Gmail API so before using door you need to turn on those things in your project to enable the API what you need to do in your project you need to go to menu more products Google workspace and product Library go to more products so let me go to Google workspace with that it is here Google workspace and then product library then what it is saying click the page that you want to turn on click enable simply scroll down and you can see Google type in Gmail API so let me click on Google Drive API and let me enable it it will go back you can see here also we get the option to enable API and services let me click here let me go and enable the Gmail image as well okay so click on Gmail API and enable it so we have enabled two apis Google Drive API and Gmail API in my project so we are done with the second step as well now what is the third step learn how authentication authorization work this already I explained in my previous videos during development you register your app in the Google Cloud console which we are doing defining authorization scope and access credential to authenticate your app with the API key and DJ credentials or service account cadences which are going to do now go to Next Step which is called configure your app auth consent screen if you wanted to do you need to go to menu APN services or consent screen API and services and oauth constant screen select the user type for your app click on create complete the app registration form save and continue add the movie scope so if you see internal only available to users within the organization and if you create any internal apps so that app needs to be verified by Google I don't want to get any internal app so let me clear to the external you can see available to any test user with a Google account okay and your app will start in testing mode and will only be available to you just you add to the list of test users okay that also now click on create then here to give the app name you can see whatever app name also I will show you that where you can see this app name RC app or you use the same email ID whatever I have used to login into Google Cloud then you if you want to add some logo you can go and upload it otherwise simply you can ignore it app domain if you want to if you have real-time app you simply can go and put all those details but we don't have anything right we are just ugly for testing purpose and let me add the same email ID I will develop a Content information as well let me copy paste the email address and click save and continue after that it is asking you to add or remove scope this is important step here if you see my Google Drive API and go to something API specific auth info if you come down here so Google Drive scope you need to use this scope code so that you can perform whatever actions you want to do with the Google Drive so for the testing purpose simply I'll go here you need to click on add a remove scope you can see the same thing had mentioned here as well four step number four if you are creating an app for use outside of your Google workspace organization click add a remove scope okay and you to select the Scopes I need to continue so simply click on add or remove a scope and here you can search for Drive API Gold Live AP agency will select all those things because we we're just doing some testing right so you can select all those apis okay and also you can use mail light Google Mail API suppose if these Scopes are not coming they need this one only scopes for enabled apis are listed below if you have not enabled the API in your project obviously these things will not come so make sure you enable the a click on update so you can see here everything got categorized here non-sensitive Scopes sensitives now this step is done click on Save and continue now you need to understand what it tastes users so while publishing status is set to testing okay we are not publishing our app you are just doing the same testing if you have published app then it will go for some Google review and after they approve then only you can use it so let's see bin testing scope but when the app engine testing scope then you need to add some special users so that you can test with them if you don't add those you just you cannot get the consent from them so click on ADD users and I will add the same my account only click on ADD so I have added one more user here you can add as many as users you want but I think there's some restrictions I think you can use only 100 but add to a verification so click on Save and continue okay so we have support email app logo we are not provided did everything you can see here we have configured everything now go to back to dashboard so we have done with these steps as well now go to create access credentials so here you can see that we can generate different types of credential here and iom consider with the OS client ID so you can see here go to API Services credentials create credentials both client ID everything you can see here and same thing I'm going to perform here as well I see the one that option in left hand side click on credentials you see the create credential if you click here you should see OS client ID API key service account you can see whatever means in the documentation I am concerned or I am interested in OS client ID click on that set the application tab maybe web application that will be the name because it is not going to show anywhere so wave client one and you see the redirect URL you remember in the last video I explained that once you once user provides the authentic Grant right the client will redirect the resource owner to Assassin server and once the source owner provides their consent then the source owner will be redirected to some URL L with the code right so that you need to mention what is the diet URL where you want to detect the resource owner after providing the consent so actually we don't have any specific things URL or if we don't have any real time application but mandatory you need to update the URL here and I will simply do localhost only and now you can click on create so as soon as you create it you see something OS client created and you got your client ad in client secret I will you can click you can download the Json file here also or you can have the option to download the Json file from here as well so if you open the Json file here and let me copy it and let me go to Json online editor and let you format it you can see in this Json via client ID we have something called client secret we have redirect URI then auth URI token URLs I think I will explain all those things in upcoming videos how can you generate the access token refresh token everything I will explain but the first step is done we have registered our app with the Google and we got our client ad in client second but make sure that if you are practicing yourself then please go and create your app you cannot use my client ID connect credentials because I will be deleting this right so you cannot use it so make sure that you go and register your account your app with the Google and get your client ad in plan secret okay so that's all in this video so if any dot please come into this video If you really like my videos please like comment subscribe and save those thank you everyone
Info
Channel: Retarget Common
Views: 21,457
Rating: undefined out of 5
Keywords: oauth, oauth 2.0
Id: 1-oFHjcQRmk
Channel Id: undefined
Length: 12min 21sec (741 seconds)
Published: Fri Jan 27 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.