Skip to content

Latest commit

 

History

History
110 lines (66 loc) · 2.3 KB

oauth_setup.md

File metadata and controls

110 lines (66 loc) · 2.3 KB

Oauth Setup

If you want to set up a b2c portal, you will have to follow this guide to setup the workflow.

Edit configuration

First you need to indicate where coog-api and front-end application are.

./conf edit
COOG_API_API_URL=<server location>
COOG_API_API_PROTOCOL=<http or https>
COOG_API_APP_URL=<front-end location> if different from <server location>/web/

Create API'S account

Then you will have to create some API's provider account like :

  • google - OK
  • facebook - In progress
  • twitter - NOK
  • ... and so on

Those are used to delegate user connection.

Google account

First of all you have to go there

If you don't have any project yet, then google will ask you to create one.

Name it, choose your organization, your zone and wait until it is created.

Click on the notification about your created project.

You will be redirected into your dashboard project.

Take a look into first step section.

You will see a subsection "Activate API ...", click it, you will be redirected.

You see some available APIs but maybe not the one we need "GOOGLE+ API", so click on browse all and just type "GOOGLE+ API" in the search bar.

Click on activate API

Then a new API dashboard appears and asks you to create identifiers to start. So click it.

First step

Which API do you use ? GOOGLE+ API

Which plateform do you use to call API ? Web server (example: Node.js or Tomcat)

Which data would you access ? Data user

Then click on the button

Second step

Name your client id

JS Origin authorized :

Enter your server address : http://path:port

Redirect URL authorized :

Enter redirect address url like this : http://path:port<API_PATH>/grant/connect/google/callback

Click on the button

Third step

Select your mail address and set the name that will be displayed for your user.

(optional) You can customize other things like CCG, Logo, HomePage and Privacy rules.

Fourth step

Download the file, open it and open coog configuration

./conf edit

Then just type those two variables

COOG_API_GOOGLE_SECRET=<client_secret>
COOG_API_GOOGLE_KEY=<client_id>

After that you just need to run the container or restart it.

./web server

./upgrade

Now your application can delegate authorization.