カスタムOAuth アプリの作成
カスタムOAuth アプリを作成するタイミング
CData はOAuth アプリケーション認証情報を製品に組み込んでおり、デスクトップアプリケーションまたはヘッドレスマシンから接続する際に使用できます。ただし、Web アプリケーションを使用する場合には、カスタムOAuth アプリケーションを作成する必要があります。以下の場合はユーザー自身のOAuth アプリケーションクレデンシャルを作成することを選択できます。
- 認証ダイアログのブランディングをコントロールしたいとき
- ユーザー認証後にアプリケーションがユーザーをリダイレクトするためのリダイレクトURI をコントロールしたいとき
- ユーザーからのリクエストに対する許可をカスタマイズしたいとき
Follow the steps below to create a custom OAuth app and obtain the connection properties in a specific OAuth authentication flow.
Create a Custom OAuth App
You can create a custom OAuth application for desktop applications, web applications, and headless machines. The steps are identical except for how the Redirect URI is defined.
Desktop Applications
Follow these steps:- If you have not done so already, sign up for a Bing Ads account in the Bing Ads Web application or at the Sandbox Site for a sandbox account.
- Go to the Azure portal (Azure test portal for sandbox accounts), and login with your Microsoft Account credentials when prompted.
- Under Azure Active Directory > App registrations, click New registration.
- Provide the application name and select an appropriate Supported account type. If you do not choose to allow personal Microsoft accounts, users with personal accounts are prevented from authenticating.
- How Re In the Redirect URI section, you must set an appropriate URL. For desktop applications a value such as http://localhost:33333 or another port of your choice may be set.
- Register your application and take note of your Application (client) Id. You will use it as the OAuthClientId value in the OAuth grant flow.
- In the Certificates & secrets section, click New client secret to generate a client secret and take note of the resulting value. You will use it as the OAuthClientSecret value.
Web Applications
In the OAuth flow for Web apps, you must create a Bing Ads application to obtain the OAuthClientId, OAuthClientSecret, and redirect URI.
- If you have not done so already, sign up for a Bing Ads account in the Bing Ads Web application or at the Sandbox Site for a sandbox account.
- Go to the Azure portal (Azure test portal for sandbox accounts), and login with your Microsoft Account credentials when prompted.
- Under Azure Active Directory > App registrations, click New registration.
- Provide the application name and select an appropriate Supported account type. If you do not choose to allow personal Microsoft accounts, users with personal accounts are prevented from authenticating.
- Set the Redirect URI to the page in your Web application where you would like users to be redirected with the OAuthVerifier
- Register your application and take note of your Application (client) Id. You will use it as the OAuthClientId value in the OAuth grant flow.
- In the Certificates & secrets section, click New client secret to generate a client secret and take note of the resulting value. You will use it as the OAuthClientSecret value.
Headless Machines
- If you have not done so already, sign up for a Bing Ads account in the Bing Ads Web application or at the Sandbox Site for a sandbox account.
- Go to the Azure portal (Azure test portal for sandbox accounts), and login with your Microsoft Account credentials when prompted.
- Under Azure Active Directory > App registrations, click New registration.
- Provide the application name and select an appropriate Supported account type. If you do not choose to allow personal Microsoft accounts, users with personal accounts are prevented from authenticating.
- In the Redirect URI section, you must set an appropriate URL. For desktop applications a value such as http://localhost:33333 or another port of your choice may be set.
- Register your application and take note of your Application (client) Id. You will use it as the OAuthClientId value in the OAuth grant flow.
- In the Certificates & secrets section, click New client secret to generate a client secret and take note of the resulting value. You will use it as the OAuthClientSecret value.