Creating a Custom OAuth App
When To Create a Custom OAuth Application
CData embeds OAuth Application Credentials with CData branding that can be used when connecting via a desktop application or headless application.You may choose to use your own OAuth Application Credentials when you want to
- control branding of the Authentication Dialog
- control the redirect URI that the application redirects the user to after the user authenticates
- customize the permissions that you are requesting from the user
Create an OAuth App for User Accounts
- Log in to your Box developers dashboard and click Create New App. Select your app type (e.g., Custom App).
- Select the Standard OAuth 2.0 (User Authentication) authentication method and click View Your App. After creating your app, you can click Configuration from the main menu to access your app settings.
- Note the displayed Client ID and Client Secret. You will later need to use these values to populate the OAuthClientId and OAuthClientSecret connection properties.
- Set the Redirect URI and store the specified value for later driver configuration.
- When setting up a desktop app or headless app, set the Redirect URI to http://localhost:33333 or a different port number.
- When setting up a web app, set the Redirect URI to https://<yourwebappserver:><port>.
- Select the scope of user permissions your app will request.
Create an OAuth App for Service Accounts
Follow the steps below to create an OAuth application and generate a private key. You will then authorize the service account.
- Log in to your Box developers dashboard and click Create New App. Select your app type (e.g., Custom App).
- Select the OAuth 2.0 with JWT (Server Authentication) authentication method, provide an application name, and click Create App. After creating your app, you can click Configuration from the main menu to access your app settings.
- Note the displayed Client ID and Client Secret. You will later need to use these values to populate the OAuthClientId and OAuthClientSecret connection properties.
- Select the application access level and the scope of user permissions your app will request. The enterprise access level enables you to work with existing users in your enterprise. The application-level setting restricts access to App-type users, users that have only API access.
- Generate your RSA keypair. First you need to generate your private key. You can do this by running the following OpenSSL command : openssl genrsa -aes128 -out private_key.pem 2048 (you can install and use the Cygwin package to run the OpenSSL RSA keypair if you are using Windows).
- Generate your public key by running the following OpenSSL command: openssl rsa -pubout -in private_key.pem -out public_key.pem. Copy the contents of the generated public_key.pem file and then add it by using the Add and Manage Public Keys option in your app settings.
-
Authorize the application in the enterprise admin console: Navigate to Apps > Custom Apps Manager > Add App. In the Add App modal window, provide the Client Id and click Next to identify and verify the app.
Note: If you change the JWT access scopes, you will need to reauthorize the application in the enterprise admin console: Click Apps in the main menu and then select the ellipsis button next to your JWT application name. Select Reauthorize App in the menu.