Salesforce

OAuth 2.0 Authorization (Magic xpi 4.1)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

OAuth 2.0 Authorization (Magic xpi 4.1)

The OAuth 2.0 Authorization dialog box opens when you click the OAuth 2.0 button in the Google Resource Setting window. This dialog box contains the following properties:

Property

Description

Client Secrets File

Click and select the client_secret .json file that you obtained from the Google Developers Console.

Authorization URL

A copyable read-only field containing the authorization URL that was obtained when you clicked the Get Auth URL button (below).

Code

Paste the code that you received from Google into this field.

The OAuth 2.0 Authorization dialog box has the following buttons:

Button

Description

Get Auth URL

Obtains the authorization URL. This button is enabled only when the Client Secrets File field (above) has been defined.

Launch

Launches the authorization URL in an external browser. This button is enabled only when the Authorization URL field (above) is populated.

Since version:

V4.1

Configuring the OAuth 2.0 Authorization Flow

Each request sent to Google must be identified with an appropriate API. Therefore, you must enable the APIs on the Magic xpi side (the client side) as well as on the Google side (the server side).

  1. In the Resource Repository, create a new Google resource. Click the APIs button to open the APIs list, select at least one API from the list, and then click OK.

  2. Then, create your client ID by performing the following steps in the Google Developers Console:

    1. Go to the Google Developers Console (https://console.developers.google.com/) and log in with your Calendar user credentials.

    2. Create a new project. For this example, you can call it magic xpi.

    3. Under the project that you have just created, in the sidebar on the left, click and expand APIs & auth. Next, click APIs. In the list of APIs, make sure that the status of the API that you want to work with is set to ON. The APIs supported by the Magic xpi Google connectors are Calendar API and Drive API.

    4. In the sidebar on the left, under APIs & auth, click Consent screen.

    5. In the EMAIL ADDRESS parameter, select your email. In the PRODUCT NAME parameter, enter Magic xpi and click Save. The name does not have to be Magic xpi, but this will be the name that appears on the consent page.

    6. Next, you need to create a client ID. If the Create Client ID dialog box did not open automatically when you clicked Save (above), you should click Credentials in the sidebar on the left. Then click the Create client ID button to open the Create Client ID dialog box manually.

    7. In the Create Client ID dialog box's APPLICATION TYPE section, select Installed application. In the INSTALLED APPLICATION TYPE section, select Other.

    8. Click the Create Client ID button.

    9. Once you have created the client ID, click the Download JSON button and then save the .json file on your machine.

  3. Next, perform the following steps in Magic xpi:

    1. In the Google resource that you created earlier, click the OAuth 2.0 button to open the OAuth 2.0 Authorization dialog box.

    2. In the OAuth 2.0 Authorization dialog box, select the location of the .json file that you downloaded from the Google Developers Console.

    3. Click the Get Auth URL button. A value will appear in the Authorization URL parameter.

    4. Either click the Launch button to open the URL in your default browser, or copy the URL from the Authorization URL parameter to the browser of your choice.

    5. If you are logged into your Google account, you will then be redirected to a consent page. If you are not already logged in, you need to enter your login details to get to the consent page. This page displays the application name that you defined previously in the Google Developers Console.

    6. Click the Accept button to give permission to access your Google Calendar and/or Google Drive. You will then be redirected to a page containing a code.

    7. Copy this code and return to the Magic xpi Google resource.

    8. Paste the code in the Code parameter and click OK.

    9. If no error is received at this point, the OAuth 2.0 Authorization dialog box will close. If an error occurs, click here for information about how to resolve it.

    10. Click the Google resource's Validate button to verify that the process was successful.

Reference
Attachment 
Attachment