OAuth

To provide users of your cloud with such login possibility:

Enabling OAuth for the cloud

  1. Go to OnApp Dashboard Settings > Authentication page
  2. Select OAuth Providers tab
  3. Move the Enable slider next to the required OAuth providers.

Facebook

  1. Select an icon to be displayed during the login
  2. Fill in the app key and app secret from the Facebook application

Configure Facebook application

To create and configure the Facebook application for your cloud:

    1. Log in as Facebook developer at https://developers.facebook.com/
    2. Create an application:
      • enter display name
      • select suitable category for your product
      • on the Dashboard of the created app you will see App ID and App Secret which are required in step 2 above
      • go to the Settings menu, press Add Platform and select Website
      • in the appearing field Site URL specify the address of your Control Panel
      • specify your Contact Email, otherwise your application cannot go live
      • go to Status & Review menu and make your application public using the slider in the top right corner

Google

  1. Select an icon to be displayed during the login
  2. Fill in the app key and app secret from the Google application

Configure Google application*

  1. Go to the Google Developers Console.
  2. Select a project, or create a new one by clicking Create Project. Use a single project to hold all platform instances of your app (Android, iOS, web, etc.), each with a different Client ID.

    1. In the Project name field, type in a name for your project.
    2. In the Project ID field, optionally type in a project ID for your project or use the one that the console has created for you. This ID must be unique world-wide.
    3. Click the Create button and wait for the project to be created. Note: There may be short delay of up to 30 seconds before the project is created. The project name appears at the top of the left sidebar, indicating you are now editing the project.
  3. In the left sidebar, select APIs & auth. A list of Google web services appears.
  4. Find the Google+ API service and set its status to ON—notice that this action moves the service to the top of the list.
  5. Enable any other APIs that your app requires.
  6. In the sidebar, select Credentials.
  7. In the OAuth section of the page, select Create New Client ID
    In the resulting Create Client ID dialog box, register the origins where your app is allowed to access the Google APIs, as follows. The origin is the unique combination of protocol, hostname, and port.
    1. In the Application type section of the dialog, select Web application.
    2. In the Authorized JavaScript origins field, enter the origin for your app. You can enter multiple origins to allow for your app to run on different protocols, domains, or subdomains. Wildcards are not allowed. In the example below, the second URL could be a production URL.

      http://onapp.cp
      https://myproductionurl.example.com
    3. In the Authorized redirect URI field, enter your redirect URI callback:

      http://onapp.cp/users/auth/google/callback

      It is important to set the configuration indicated in the box above, otherwise the Google will set the default value as http://onapp.cp/callback

    4. Select Create Client ID.
  8. Go into the Consent Screen and add your email address and a product name. The other fields are optional.
  9. In the resulting Client ID for web application section, note or copy the Client ID and Client secret that your app will need to use to access the APIs.

* Configurations are taken from official Goggle instructions "Step 1: Create a client ID and client secret".

Connecting the enabled OAuth provider to user profile

To connect a user profile to either of above OAuth providers and be able to log in with it, the user has to:

  1. Log in to OnApp cloud using OnApp credentials.
  2. Go to their own profile by clicking the name on the top panel of the dashboard or in the list of users in Users and Groups menu.
  3. In the Oauth Authentication section press the Connect button next to the required provider.
  4. User will be redirected to confirm such connection.

Upon completion, the user will be able to log in to OnApp with the OAuth Provider they have connected.