Setting up Google OAuth Credentials
For setting up Google Credentials You need to follow few steps:
Step 1 : signup or signin
Create or login your google consol by visiting the Google API Console to obtain OAuth 2.0 credentials such as a client ID and client secret that are known to both Google and your application.
Step 2 : create credentials
- First select the project on top right section in nav bar
- Now click on credentials link available in left sidebar.
- After clicking on
Create credentials
a pop up will appear - In this pop up select
OAuth client ID
option
- see the following image for reference
Step 3 : configure
In this section you need to provide some inputs for creating OAuth client ID
- select
web application
option form Application type drop down menu - on next input provide the application name.
- now provide you url for
Authorized JavaScript origins
. keep separate url for productions and development environment. for examplehttp://localhost:8000
- after this you need to provide a
Authorized redirect URI
google will redirect user to this url after navigating user to auth page - Now click on create button and create your
OAuth client ID
would be created.
see the following image for reference
Step 4 : save details
After creating the OAuth ID another pop up will appear immediately.
copy and paste the client id and secret to a secure place. you can also download a json file which contains both id ans secret by clicking DOWNLOAD JSON
link appear bottom left corner of pop up window
see the following image for reference
Step 5: manage credentials API settings
Now you have your client ID
and Secret
. its time to map these details into jaseci Configuration for this
First login into your jaseci admin by visiting
http://localhost:8000/admin
Now in left sidebar click on
OAuth Credentials
link underJASECI_SSO
sectionthen click on
Add oauth credentials
button available on top right.see the following image for reference
Step 6: manage credentials API settings
After clicking Add Oauth credentials
button you will land the page where you can add the credentials
- first select the authentication provider type
- paste your
client ID
received from authenticate service provider. - paste your
client Secret
received from authenticate service provider. - select is active flag to yes, in case if you want to disable this configuration simply set this flag to false or No.
- Now click on
save
button to save the configuration.
- see the following image for reference
![alt text](https://drive.google.com/uc?export=view&id=1kaw6H8bPi6jXBMrKLbnllJklXUHciv7u)
now you need to restart you jaseci server by running
jsserv runserver
for test the configuration navigate http://localhost:8000/auth/examples/google/