FME Version
Introduction
ArcGIS Online supports OAuth 2.0 authentication. This article explains how to set up an ArcGIS Online Web Application and an FME Web Connection for FME to connect using OAuth 2.0.
If you are trying to create an ArcGIS Enterprise Portal Web Connection, please use this article instead: How to Create an ArcGIS Enterprise Portal Web Connection (OAuth 2.0)
Step-by-Step Instructions
Part 1: FME Form
1. Create an Application in ArcGIS Online
Let's start by creating an ArcGIS Online application that will be used in the FME Web Connection.
Log into ArcGIS Online and go to the Content view. Click on New item.
Choose ‘Application'
From the list of Application types, choose Other application. Click Next.
Finally, enter a Title and Tags (optional). Click Save to create the application.
After saving, the new application will be open. You can also find it on your contents page if you need to access it in the future.
The Overview displays the credentials needed to configure the FME ArcGIS Online Web Service, which is used to create Web Connection. These credentials are also available from the Settings page. Keep this page open, as you will need to copy and paste the credentials into FME.
2. Create a Web Service in FME Form
Open FME Workbench. Go to Tools, then select FME Options… Find and select Web Connections, then select Manage Services...
Click on the "+" drop-down menu in the bottom left corner and then Create From > Esri ArcGIS Online.
Give the Web Service a name. It’s good to include the service, “ArcGIS Online”, in the name.
Copy and paste the Client ID and Client Secret from the ArcGIS Online Application Overview page into the corresponding fields in the Web Service. Click Apply, then Close.
3. Create a Web Connection in FME Form
After closing the Web Services page, you should be back Web Connection page. If you aren’t, go to Tools > FME Options > Web Connections to reopen it. Click on the “+” button to add a new connection.
Select the Web Service created in Step 2 and give your web connection a name. Click on Authenticate.
This will open a prompt from ArcGIS Online. Enter your ArcGIS Online Account credentials, or click your account if using SAML (single sign on), and click Sign In. After successfully signing in, your ArcGIS Online Web Connection is ready to use!
4. Test the Web Connection
In FME Workbench, add an Esri ArcGIS Online (AGOL) Feature Service Reader to the canvas.
Click Parameters. In the Parameters, choose your new ArcGIS Online Web Connection. Click the ellipsis (...) to choose the feature service and layer(s) you want to read. Click OK on the Parameters and OK again to create the reader.
Run to test that the reader works!
If you are also using FME Flow, keep the workspace open, as we will use it to configure FME Flow in the next part.
Part 2: FME Flow
We will go through a few extra steps to get this working in FME Flow.
1. Add a Redirect URI to the ArcGIS Online Application
Go back to your ArcGIS Online Application and click Manage next to Credentials (you can also click Settings from the top menu bar).
Enter an Application URL. FME does not use this URL, but ArcGIS Online requires it before saving Redirect URIs. Enter any HTTPS URL; for example, https://www.arcgis.com/
Under Redirect URLs, click Add and add your FME Flow OAuth URL in the form of: http://<yourServerhost>/fmeoauth. Click Save.
2. Upload the Web Connection and Web Service to FME Flow
Back in FME Workbench, let’s publish the workspace to FME Flow to upload the Web Connection and associated Web Service. Click the Publish button in the top right.
In the Publish Wizard, choose your FME Flow web connection and click Next. Choose a Repository to upload the workspace to (or create a new one) and Next again.
Upload the connection to FME Flow by selecting it and clicking Next.
Click Publish.
3. Add the Redirect URI
Log into your FME Flow. From Files and Connections, select Web Connections. Click Manage Web Services.
Click on your Web Service name
In the Redirect Uri, enter the same FME Flow OAuth URL that you added to the ArcGIS Online Application in Step 1. Click OK.
Return to the Web Connections page and click on the Web Connection.
Click Authorize. When prompted, enter your ArcGIS Online credentials, or click your account if using SAML (single sign on), and click Sign In. After successfully authorizing your connection, you should see a green checkmark next to the web connection name. Click OK.
4. Run the Workspace on FME Flow
Finally, let’s run the workspace to confirm the connection is working on FME Flow.
From the side menu, click Run Workspace. Find the workspace that was just uploaded. Then, click Run to run the workspace. The workspace should run successfully, demonstrating that the connection works.
Comments
1 comment
Hi, I've recently done this to try to produce a more stable connection into ArcGIS Online. When I test the Web connection in FME Form and Flow, it works fine when and successfully authenticates. However, when I attempt to connect via a FeatureReader, I receive the following error:
"Python Exception: <FMESDException>: Type: 4, Number: 1, Message: Failed to get authorization query string."
It seems there are a few queries being raised about this throughout Safe's web forum. Is there a common fix for this, as it seems odd?
Please sign in to leave a comment.