Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed translated content for 'zh'
Sv translation
languageen


Note

Available since BellaDati 2.9.18

Process

Get the User’s Permission
Anchor
get_the_users_permission
get_the_users_permission

Request Structure

URL

https://service.belladati.com/auth/oauth/request

Method

POST

Parameters

  • client_id: Your account's client id. To configure it, please visit your domain settings page.
  • redirect_uri: Tells the authorization server where to send the user back to after they approve the request.
  • response_type=CODE: This tells the authorization server that the application is initiating the authorization code flow.
  • state: The application generates a random string and includes it in the request. It should then check that the same value is returned after the user authorizes the app. 
Example http://service.belladati.com/auth/oauth/request:new?client_id=8208110359&redirect_uri=http://service.belladati.com/auth&response_type=CODE&state=122342

Returns

Opens authorization page

https://service.belladati.com/redirect?code=g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3&state=122342

Authorize the request 
Anchor
authorize_request
authorize_request

When a user visits this URL, the authorization server will present them with a pop-up asking if they would like to authorize this application’s request.

If the user approves the request, the authorization server will redirect the browser back to the redirect_uri specified by the application, adding a code and state to the query string.

https://service.belladati.com/redirect?code=g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3&state=122342

Exchange the Authorization Code for an Access Token
Anchor
exchange_auth_code
exchange_auth_code

Request Structure

URL

http://localhost:8080/oauth/v2/accessToken

Method

POST

Parameters

  • grant_type=authorization_code: This tells the token endpoint that the application is using the Authorization Code grant type.
  • code: The application includes the authorization code it was given in the redirect.
  • redirect_uri: The same redirect URI that was used when requesting the code.
  • client_id: Your account's client id. To configure it, please visit your domain settings page.
  • client_secret: The application’s client secret. This ensures that the request to get the access token is made only from the application, and not from a potential attacker that may have intercepted the authorization code.
Example http://localhost:8080/oauth/v2/accessToken?grant_type=authorization_code&code=WM0iK6vhik2aUvGmvjiAjl4q3nvWqE3uUcd1Y93V&redirect_uri=http://localhost&client_id=8208110359

Returns

JSON with access token
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache

{
  "access_token":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3",
  "token_type":"bearer",
  "expires_in":3600,
  "refresh_token":"IwOGYzYTlmM2YxOTQ5MGE3YmNmMDFkNTVk",
}


Sv translation
languageja


Note

BellaDati 2.9.18以降で利用可能です。

プロセス

ユーザー許可の取得
Anchor
get_the_users_permission
get_the_users_permission

リクエスト構造

URL

https://service.belladati.com/auth/oauth/request

メソッド

POST

パラメーター

  • client_id: アカウントの client id。設定するには、ドメイン設定ページにアクセスしてください。
  • redirect_uri: ユーザーがリクエストを承認した後、ユーザーをどこに送り返すかを、認証サーバーに指示します。
  • response_type=CODE: アプリケーションが認証コードフローを開始していることを、認証サーバーに通知します。
  • state: アプリケーションはランダムな文字列を生成し、それをリクエストに含めます。次に、ユーザーがアプリを承認した後、同じ値が返されることを確認する必要があります。
例 http://service.belladati.com/auth/oauth/request:new?client_id=8208110359&redirect_uri=http://service.belladati.com/auth&response_type=CODE&state=122342

リターン

承認ページを開きます。

https://service.belladati.com/redirect?code=g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3&state=122342

リクエストの承認 
Anchor
authorize_request
authorize_request

ユーザーがこのURLにアクセスすると、認証サーバーは、このアプリケーションのリクエストを認証するかどうかを尋ねるポップアップを表示します。

ユーザーがリクエストを承認すると、認証サーバーはブラウザをアプリケーションで指定されたredirect_uriにリダイレクトし、クエリー文字列にコードとstateを追加します。

https://service.belladati.com/redirect?code=g0ZGZmNjVmOWIjNTk2NTk4ZTYyZGI3&state=122342

認証コードをアクセストークンと交換
Anchor
exchange_auth_code
exchange_auth_code

リクエスト構造

URL

http://localhost:8080/oauth/v2/accessToken

メソッド

POST

パラメータ

  • grant_type=authorization_code: アプリケーションが認証コード付与タイプを使用していることを、トークンエンドポイントに通知します。
  • code: アプリケーションには、リダイレクトで指定された認証コードが含まれています。
  • redirect_uri: コードをリクエストしたときに使用されたものと同じリダイレクトURI。
  • client_id: アカウントの client id。設定するには、ドメイン設定ページにアクセスしてください。
  • client_secret: アプリケーションのクライアントシークレット。これにより、アクセストークンを取得するリクエストはアプリケーションからのみ行われ、認証コードを傍受した可能性のある潜在的な攻撃者からは行われないことが保証されます。
例 http://localhost:8080/oauth/v2/accessToken?grant_type=authorization_code&code=WM0iK6vhik2aUvGmvjiAjl4q3nvWqE3uUcd1Y93V&redirect_uri=http://localhost&client_id=8208110359

リターン

JSON with access token
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-store
Pragma: no-cache

{
  "access_token":"MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3",
  "token_type":"bearer",
  "expires_in":3600,
  "refresh_token":"IwOGYzYTlmM2YxOTQ5MGE3YmNmMDFkNTVk",
}