Oracle® Fusion Middleware Oracle Access Management開発者ガイド 11g リリース2 (11.1.2.2.0) for All Platforms B69537-08 |
|
前 |
次 |
この章では、Oracle Access Management OAuth Service APIについて説明します。この章の内容は次のとおりです。
cURLの使用に関する注意
この章では、cURLを使用して、OAuthクライアントがMobile and Social OAuthサーバーに送信するRESTコールについて説明します。cURLは、cURLのWebサイト(http://curl.haxx.se/
)からダウンロードできるフリー・ソフトウェアです。
サーバーへのRESTコールの送信にcURLを使用することにより、クライアントとサーバーとのやり取りについての理解を深めることができます。また、これを便利なトラブルシューティング・ツールとしても使用できます。
注意: Windowsでは、一重引用符(' )を含むcURLコマンドは失敗します。可能であれば、一重引用符のかわりに二重引用符( " )を使用してください。
コマンドに一重引用符と二重引用符の両方が必要な場合、二重引用符を円記号でエスケープし(例: |
注意: このガイドにおいて、cURLのコマンドおよびサーバー・レスポンスでの改行は、単に表示上の都合により使用されています。 |
この項では、3-legged OAuthフロー用のRESTコールについて説明します。詳細は、Oracle Fusion Middleware Oracle Access Management管理者ガイドのOAuth 3-legged認可の理解に関する項を参照してください。
次のサンプルは、フロントチャネル・フローとバックチャネル・フローの2つの部分に分かれています。フロントチャネル・フローはOAuthサーバーとリソース所有者(またはエンド・ユーザー)の間で行われ、バックチャネル・フローはOAuthサーバーとクライアント・アプリケーションの間で行われます。
次のフローでは、クライアント・アプリケーションは、ブラウザを使用してユーザー(リソース所有者)をOAuthサーバーの認可エンドポイントにリダイレクトします。ユーザーはOAuthサーバーで認証を行う必要があり、オプションでリクエストしたリソースへのアクセスの認可を行います(承認の提供)。ユーザーの対話が正常に完了すると、OAuthサーバーはクライアント・アプリケーションに認可コードを発行します。
その後、クライアント・アプリケーションは認可コートを使用してリソース・アクセス・トークンをリクエストしますが、これはバックチャネル・リクエストです。
curl - i --request GET "https://host:port/ms_oauth/oauth2/endpoints/oauthservice/authorize? response_type=code &client_id=54321id &redirect_uri=http://client.example.com/return &scope=user_read&state=xyz"
表14-1 リクエストのパラメータ
名前 | 説明 | 必須 |
---|---|---|
|
このフローの場合、値は |
必須 |
|
認可サーバーによって付与されるクライアント識別子。 認可サーバーは |
必須 |
|
クライアント・アプリケーションのリダイレクトURI認可コード。送信されない場合、構成/クライアント・レジストリがチェックされ、 |
オプション |
|
空白区切りの値を使用します。構成/スコープ・レジストリでスコープ値を定義します。スコープが送信されない場合、または無効なスコープが指定された場合、エラー・レスポンスがクライアント・アプリケーションの |
必須 |
|
リクエストとコールバックの間で状態を保持するためにクライアントによって使用される不透明な値。ユーザー・エージェントをクライアントにリダイレクトする際、認可サーバーはこの値を含めます。クロスサイト・リクエスト・フォージェリを防ぐためにこのパラメータを使用します。 |
推奨 |
サンプル認可コード・レスポンス
https: //client.example.com/return?code=eyJhbG...rWWk8hbs_o6uY&state=xyz
リソース所有者がアクセス・リクエストに応じた場合、認可サーバーは認可コードを発行し、application/x-www-form-urlencoded
形式を使用してリダイレクションURIの問合せコンポーネントに次のパラメータを追加することでクライアントに認可コードを渡します。
表14-2 レスポンスのパラメータ
名前 | 説明 |
---|---|
|
次の情報が含まれます。
|
|
認可リクエストで指定された値と同じ値。認可リクエストで指定された場合にのみ含まれます。 |
エラー・レスポンス
検証エラーが検出された場合、エラー・コードおよび説明を含むJSONレスポンスが送信されます。次に、エラー・コードの一部とその説明を示します。
invalid_client
- クライアント識別子が無効
access_denied
- エンド・ユーザーが認可を拒否
invalid_redirect_uri
- redirect_uriがクライアント・アプリケーションと不一致
invalid_scope
- リクエストされたスコープは無効、不明または不正
server_error
- ランタイム処理エラー
エラー・レスポンス・サンプル
{”error_code”:”invalid_client”, ”error_description”:”client identifier invalid”}
このフローは、OAuthサーバー(認可サーバー)とクライアント・アプリケーションの間で行われます。サンプルでは、OAuthアクセス・トークンの認可コードの交換方法を示します。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://hostname:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' redirect_uri=http%3A%2F%2Fclient.example.com:17001%2Freturn &grant_type=authorization_code &code=eyJhbG...rWWk8hbs_o6uY '
grant_type
パラメータ値はauthorization_code
で、code
パラメータ値は認可エンドポイントで生成された認可コードである必要があります。redirect_uri
パラメータが認可リクエストに含まれていた場合、redirect_uri
トークンを送信する必要があります。値は同じである必要があります。
サンプル・レスポンス
{ "access_token": "2YotnFZFEjr1zCsicMWpAA", "token_type": "Bearer", "expires_in": 3600, "refresh_token": "tGzv3JOkF0XG5Qx2TlKWIA" }
この項では、リソース・アクセス・トークンの取得方法を示すRESTリクエストのサンプルについて説明します。リクエストでリソースが送信されない場合、結果のトークンをアイデンティティ・トークンとして使用できます。詳細は、Oracle Fusion Middleware Oracle Access Management管理者ガイドのOAuth 2-legged認可の理解に関する項を参照してください。この項では、次の例を示します。
通常、この項で説明されているリクエストには次のようなレスポンスが返されます。
注意: リクエストされたスコープがオフライン・スコープに指定されている場合、サーバー・レスポンスにrefresh_token 要素が含まれます。どのスコープもオフラインでない場合、refresh_token 要素は送信されません。 |
HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Date: Wed, 04 Dec 2013 21:52:03 GMT Pragma: no-cache Transfer-Encoding: chunked Content-Type: application/json X-ORACLE-DMS-ECID: 09edd9b26949554d:-1f8be51:142bf50a0dc:-8000-0000000000001b27 X-Powered-By: Servlet/2.5 JSP/2.1 { "expires_in":3600, "token_type":"Bearer", "access_token":"<access token value>", "refresh_token":"<refresh token value"> }
次のサンプルでは、クライアント資格証明を使用してアクセス・トークンを取得する方法を示します。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://hostname:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=client_credentials &scope=scope1%20scope2 '
次のサンプルでは、HTTP BasicヘッダーにユーザーIDとパスワードの資格証明およびクライアントID、シークレットが含まれたリソース所有者のリクエストを示します。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://hostname:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=password &username=userxyz &password=pwd123xyz &scope=scope1%20scope2'
次のサンプルでは、Basic認可ヘッダーでclientid:clientsecret
とともにリフレッシュ・トークンを使用します。
curl -i -H 'Authorization: Basic dGVzdDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://hostname:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=refresh_token &refresh_token=<refresh-token-value>'
次の例では、クライアント資格証明としてクライアント・アサーションを使用します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=refresh_token &refresh_token=<refresh-token-value> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer &client_assertion=<client-assertion-value>'
次のサンプルでは、サード・パーティによって生成されたSAMLクライアント・アサーションを使用するクライアント資格証明リクエストを示します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'client_id=54321id &grant_type=client_credentials &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> &scope=scope1%20scope2'
次のサンプルでは、IDM OAuthサーバーまたはサード・パーティによって生成されたJWTクライアント・アサーションを使用した認可コードのリクエストを示します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'client_id=54321id &grant_type=client_credentials &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> &scope=scope1%20scope2'
次のサンプルでは、HTTP BasicヘッダーにユーザーIDとパスワードの資格証明およびクライアントID、シークレットが含まれたリソース所有者のリクエストを示します。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=password &username=user123 &password=password123 '
次のサンプルでは、ユーザーIDおよびパスワード資格証明に加えてサード・パーティによって生成されたJWTクライアント・アサーションを使用したリソース所有者のリクエストを示します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=password &username=userxyz &password=pwd123xyz &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> &scope=scope1%20scope2'
次の例は、ユーザーIDおよびパスワード資格証明に加えてサード・パーティによって生成されたSAMLクライアント・アサーションを使用した認可コードのリクエストです。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=password &username=userAbc123 &password=passwordAbc123 &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> &scope=scope1%20scope2'
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer &assertion=<SAML user assertion value>' &scope=scope1%20scope2
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> &assertion=<SAML user assertion value> &scope=scope1%20scope2'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> &assertion=<SAML user assertion value> &scope=scope1%20scope2'
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &assertion=<JWT user assertion value> &scope=scope1%20scope2'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> &assertion=<JWT user assertion value> &scope=scope1%20scope2'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> &assertion=<JWT user assertion value> &scope=scope1%20scope2'
この項では、OAuthサーバーからのアクセス・トークン(クライアントおよびユーザーのアイデンティティ・トークン)の取得方法を示します。次のサンプルがあります。
この項では、クライアント・アイデンティティ・トークンを取得する3つの方法を示します。
このサンプルは、クライアントIDとシークレットをHTTP Basic認可ヘッダーに含めます。
curl - i - H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' - H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http: //host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=client_credentials'
サンプル・レスポンス
{ "oracle_client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer", "expires_in": 604800, "token_type": "Bearer", "oracle_tk_context": "client_assertion", "access_token": "access token value" > , "refresh_token": "<refresh token value>" }
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' client_id=54321id &grant_type=client_credentials &client_assertion_type= urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> '
最初の例のサンプル・レスポンスを参照してください。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' client_id=54321id &grant_type=client_credentials &client_assertion_type= urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> '
最初の例のサンプル・レスポンスを参照してください。
この項のサンプルでは、アクセス・トークンまたはユーザー・アサーションとも呼ばれるユーザー・アイデンティティ・トークンの取得方法を示します。3つのカテゴリがあります。
サンプル・レスポンス
すべてのリクエストで次のようなレスポンスを受け取ります。
{ "expires_in": 28800, "token_type": "Bearer", "oracle_tk_context": "user_assertion", "oracle_grant_type": "urn:ietf:params:oauth:grant-type:jwt-bearer", "access_token": "<access token value>" }
このカテゴリには3つのサンプルがあります。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=password &username=sampleuser &password=samplepassword '
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=password &username=sampleuser &password=samplepassword &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> '
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=password &username=sampleuser &password=samplepassword &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value>'
このカテゴリには3つのサンプルがあります。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer &assertion=<SAML user assertion value>'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> &assertion=<SAML user assertion value>'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Asaml2-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> &assertion=<SAML user assertion value>'
このカテゴリには3つのサンプルがあります。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &assertion=<JWT user assertion value>'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Asaml2-bearer &client_assertion=<SAML client assertion value> &assertion=<JWT user assertion value>'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &client_assertion=<JWT client assertion value> &assertion=<JWT user assertion value>'
この項では、リソース・アクセス・トークンの検証方法を示すRESTリクエストのサンプルについて説明します。次の例を示します。
次の例は、HTTP BasicヘッダーにクライアントIDおよびシークレットを含むアクセス・トークンの検証リクエストです。アサーション値は通常の文字列ではなく、JSONであることに注意してください。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Fresource-access-token%2Fjwt &oracle_token_action=validate &scope=UserProfile.users.read &assertion={"<assertion>":"<assertion-value>"}'
レスポンス
{"successful":true}
次の例は、資格証明として使用されるクライアント資格証明権限付与タイプを使用してJWTクライアント・アサーションを取得するアクセス・トークンの検証リクエストです。
curl -i --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Fresource-access-token%2Fjwt &oracle_token_action=validate &scope=ConsentManagement.grant &assertion=<access token value> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer &client_assertion=<JWT client assertion value>'
レスポンス
{"successful":true}
この項では、OAM OAuth認可サーバーに問い合せてOAuthトークンについてのメタ情報を判断する方法を示すRESTリクエストのサンプルについて説明します。この処理はOAuthイントロスペクションと呼ばれています。アクセス・トークンの検証と同じですが、レスポンスの一部としてアクセス・トークン内に追加要求データが含まれています。
oracle_token_attrs_retrieval
パラメータを含めると、サーバーはレスポンスに追加トークン要求データを含めます。このパラメータはスペース区切りで次の要求名をとります。
iss aud exp prn jti exp iat oracle.oauth.scope oracle.oauth.client_origin_id oracle.oauth.user_origin_id oracle.oauth.user_origin_id_type oracle.oauth.tk_context oracle.oauth.id_d_id oracle.oauth.svc_p_n
この項では、次の例を示します。
次のトークン・イントロスペクションの例は、アクセス・トークンの検証の項で示された最初のアクセス・トークン検証リクエストと同じですが、oracle_token_attrs_retrieval
パラメータが追加されています。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Fresource-access-token%2Fjwt &oracle_token_action=validate &scope=UserProfile.users.read &oracle_token_attrs_retrieval=iss%20aud%20exp%20prn%20jti%20exp%20iat %20oracle.oauth.scope%20oracle.oauth.client_origin_id %20oracle.oauth.user_origin_id%20oracle.oauth.user_origin_id_type %20oracle.oauth.tk_context%20oracle.oauth.id_d_id%20oracle.oauth.svc_p_n &assertion=<access token value>'
レスポンス
{"successful":true, "oracle_token_attrs_retrieval": {"oracle.oauth.tk_context":"resource_access_tk", "exp":1386276668000, "iss":"www.oracle.example.com", "prn":"54321id", "oracle.oauth.client_origin_id":"54321id", "oracle.oauth.scope":"ConsentManagement.grant", "jti":"0fb4eef6-44ce-46ac-9230-7a335c05bf0f", "oracle.oauth.svc_p_n":"OAuthServiceProfile", "iat":1386273068000, "oracle.oauth.id_d_id":"12345678-1234-1234-1234-123456789012" } }
次のトークン・イントロスペクションの例は、アクセス・トークンの検証の項で示された2番目のアクセス・トークン検証リクエストと同じですが、oracle_token_attrs_retrieval
パラメータが追加されています。
curl -i --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Fresource-access-token%2Fjwt &oracle_token_action=validate &scope=ConsentManagement.grant &oracle_token_attrs_retrieval=iss%20aud%20exp%20prn%20jti%20exp%20iat %20oracle.oauth.scope%20oracle.oauth.client_origin_id %20oracle.oauth.user_origin_id%20oracle.oauth.user_origin_id_type %20oracle.oauth.tk_context%20oracle.oauth.id_d_id%20oracle.oauth.svc_p_n &assertion=<access token value> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer &client_assertion=<JWT client assertion value>'
レスポンス
{"successful":true, "oracle_token_attrs_retrieval": {"oracle.oauth.tk_context":"resource_access_tk", "exp":1386276668000, "iss":"www.oracle.example.com", "prn":"54321id", "oracle.oauth.client_origin_id":"54321id", "oracle.oauth.scope":"ConsentManagement.grant", "jti":"0fb4eef6-44ce-46ac-9230-7a335c05bf0f", "oracle.oauth.svc_p_n":"OAuthServiceProfile", "iat":1386273068000, "oracle.oauth.id_d_id":"12345678-1234-1234-1234-123456789012" } }
この項では、リソース・アクセス・トークンの取消し方法を示すRESTリクエストのサンプルについて説明します。次の例を示します。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Fresource-access-token%2Fjwt &oracle_token_action=delete &assertion=<access token value>'
レスポンス
{"successful":true}
curl -i --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Fresource-access-token%2Fjwt &oracle_token_action=delete &assertion=<access token value> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer &client_assertion=<JWT client assertion value>'
レスポンス
{"successful":true}
この項では、次のユーザー・プロファイル・サービスRESTコマンドについて説明します。
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.me.read
というスコープが必要です。
curl -i --request GET "http://host:port/ms_oauth/resources/userprofile/me" -H 'Authorization:<OAUTH ACCESS TOKEN>'
レスポンス
{ "uid": "weblogic", "description": "This user is the default administrator.", "lastname": "Doe", "commonname": "John", "uri": "\/ms_oauth\/resources\/userprofile\/me\/weblogic" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.me.write
というスコープが必要です。
curl -H "Content-Type: application/json" --request PUT "http://host:port/ms_oauth/resources/userprofile/me" -H 'Authorization:<OAUTH ACCESS TOKEN>' -d '{ "description": "user2description" }'
レスポンス
{ "uid": "weblogic", "description": "user2description", "lastname": "Doe", "commonname": "John", "uri": "\/ms_oauth\/resources\/userprofile\/me\/weblogic" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.users.write
というスコープが必要です。
curl -H "Content-Type: application/json" --request POST http://host:port/ms_oauth/resources/userprofile/users -H 'Authorization:<OAUTH ACCESS TOKEN>' -d '{ "uid": "John", "description": "test user", "lastname": "Anderson", "commonname": "John Anderson", "firstname": "John" }'
レスポンス
{ "uid": "John", "guid": "FE1D7BD0590111E1BFDCF77FB8E715D5", "description": "test user", "name": "John", "lastname": "Anderson", "commonname": "John Anderson", "loginid": "John", "firstname": "John", "uniquename": "FE1D7BD0590111E1BFDCF77FB8E715D5", "uri": "\/ms_oauth\/resources\/userprofile\/people\/John" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.users.read
というスコープが必要です。
curl -i --request GET -H 'Authorization:<OAUTH ACCESS TOKEN>' http://host:port/ms_oauth/resources/userprofile/users/John
レスポンス
{ "uid": "John", "guid": "FE1D7BD0590111E1BFDCF77FB8E715D5", "description": "test user", "name": "John", "lastname": "Anderson", "commonname": "John Anderson", "loginid": "John", "firstname": "John", "uniquename": "FE1D7BD0590111E1BFDCF77FB8E715D5", "uri": "\/ms_oauth\/resources\/userprofile\/people\/John" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.users.write
というスコープが必要です。
curl -H "Content-Type: application/json" --request PUT http://host:port/ms_oauth/resources/userprofile/users/John -H 'Authorization:<OAUTH ACCESS TOKEN>' -d '{ "description":"test user1" }'
レスポンス
{ "uid": "John", "guid": "FE1D7BD0590111E1BFDCF77FB8E715D5", "description": "test user1", "name": "John", "lastname": "Anderson", "commonname": "John Anderson", "loginid": "John", "firstname": "John", "uniquename": "FE1D7BD0590111E1BFDCF77FB8E715D5", "uri": "\/ms_oauth\/resources\/userprofile\/people\/John" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.users.write
というスコープが必要です。
curl -i --request DELETE -H 'Authorization:<OAUTH ACCESS TOKEN>' http://host:port/ms_oauth/resources/userprofile/users/John
レスポンス
レスポンスはありません。
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.users.write
というスコープが必要です。
curl -H "Content-Type: application/json" --request POSThttp://host:port/ms_oauth/resources/userprofile/groups -H 'Authorization:<OAUTH ACCESS TOKEN>' -d '{ "description":"group1 testing", "commonname":"group1" }'
レスポンス
{ "guid": "2259C6C0592011E1BFDCF77FB8E715D5", "description": "group1 testing", "name": "group1", "commonname": "group1", "uniquename": "2259C6C0592011E1BFDCF77FB8E715D5", "uri": "\/ms_oauth\/resources\/userprofile\/groups\/group1" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.groups.read
というスコープが必要です。
curl -i --request GET "http://host:port/ms_oauth/resources/userprofile/groups/group1" -H 'Authorization:<OAUTH ACCESS TOKEN>'
レスポンス
{ "guid": "2259C6C0592011E1BFDCF77FB8E715D5", "description": "group1 testing", "name": "group1", "commonname": "group1", "uniquename": "2259C6C0592011E1BFDCF77FB8E715D5", "uri": "\/ms_oauth\/resources\/userprofile\/groups\/group1" }
このリソース・サーバーURIは、OAuthアクセス・トークンによって保護されています。デフォルト構成を使用してこのアクションを完了するには、OAuthアクセス・トークンにuserProfile.groups.write
というスコープが必要です。
curl -H "Content-Type: application/json" --request PUT http://host:port/ms_oauth/resources/userprofile/groups/group1 -H 'Authorization:<OAUTH ACCESS TOKEN>' -d '{ "description":"group11 testing" }'
レスポンス
{ "guid": "2259C6C0592011E1BFDCF77FB8E715D5", "description": "group11 testing", "name": "group1", "commonname": "group1", "uniquename": "2259C6C0592011E1BFDCF77FB8E715D5", "uri": "\/ms_oauth\/resources\/userprofile\/groups\/group1" }
このインタフェースを使用してカスタム・ユーザー・インタフェースをレンダリングし、ユーザー承認プロセスを実行することで承認エクスペリエンスをカスタマイズします。このインタフェースでは、POST/consentmanagement/retrieve grantを使用してすべてのユーザーについてクライアントの承認ステータスとスコープが取得されます。このインタフェースを使用すると、クライアントで以前に付与したすべてのスコープをユーザーに表示することができます。
UserConsentサービスを有効にするには、Oracle Fusion Middleware Oracle Access Management管理者ガイドのOAuth承認管理サービスの構成に関する項を参照してください。必要に応じてScopesセクションで権限を構成します。
この項では、次の項目について説明します。
次のサンプルでは、client_credentials
付与タイプを使用してアクセス・トークンを取得する方法を示します。
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=client_credentials &scope=ConsentManagement.retrieve ConsentManagement.grant ConsentManagement.revoke'
レスポンス
{ "expires_in": 3600, "token_type": "Bearer", "access_token": "eyJhbGciOiJSyfecz3p...nYlReMjATbLs" }
この項には、3つのサンプル・リクエストが含まれています。次のレスポンスは、3つのリクエストすべてに特有です。
レスポンス
HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Date: Fri, 16 Aug 2013 18:26:25 GMT Pragma: no-cache Transfer-Encoding: chunked Content-Type: application/json X-ORACLE-DMS-ECID: 316690b8df2db0a3:-794ed83e:140885d3651:-8000-0000000000000028 X-Powered-By: Servlet/2.5 JSP/2.1 X-OAUTH-REST-VERSION: v1
リクエスト
次のサンプルでは、リクエストのretrieve
エンドポイントへの送信を示します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/resources/consentmanagement/retrieve -d ' scope=samplePhotoServer.photo.read &client_id=54321id &oracle_user_id=weblogic &lang=en ' -H 'Authorization: eyJhbGciOiJSUzUxM...eZJpL08yCI'
次のサンプルでは、リクエストをgrant
エンドポイントに送信します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/resources/consentmanagement/grant -d ' scope=samplePhotoServer.photo.read &client_id=54321id &oracle_user_id=weblogic &lang=en ' -H 'Authorization: eyJhbGciOiJSUzUxM...3OxH7jIRqGL-6w'
最後のサンプルでは、revoke
エンドポイントへ送信されるリクエストを示します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/resources/consentmanagement/revoke -d ' scope=samplePhotoServer.photo.read &client_id=54321id &oracle_user_id=weblogic &lang=en ' -H 'Authorization: eyJhbGciOiJSUzUxM...3OxH7jIRqGL-6w'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/resources/consentmanagement/grant -d ' scope=UserProfile.me.read &client_id=54321id &oracle_user_id=weblogic &lang=en ' -H 'Authorization: eyJhbGciOiJSUzUxM...3OxH7jIRqGL-6w'
レスポンス
HTTP/1.1 200 OK
curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=password &username=weblogic &password=password123 &scope=UserProfile.me.read'
レスポンス
{ "expires_in": 3600, "token_type": "Bearer", "refresh_token": "eyJhbGciOiJSUzUxM...t7ihyNjqbb6Q9bCwE", "access_token": "eyJhbGciOiJSUzUxM...MIXI0ztb6NfOBMb4A" }
次のサンプルでは、無認可のリクエストとレスポンスを示します。
curl -i --request GET "http://host:port/ms_oauth/resources/userprofile/me" -H 'Authorization: eyJhbGciOiJSUzUxM...MIXI0ztb6NfOBMb4A'
レスポンス
HTTP/1.1 401 Unauthorized Date: Fri, 16 Aug 2013 18:47:44 GMT Transfer-Encoding: chunked Content-Type: application/json X-ORACLE-DMS-ECID: 316690b8df2db0a3:-794ed83e:140885d3651:-8000-000000000000005e X-Powered-By: Servlet/2.5 JSP/2.1 { "message": "oracle.security.idaas.oauth.resourceserver.jaxrs.userprofile.Me.getMyProfile: resource uri is not protected", "oicErrorCode": "IDAAS-20027 : oracle.security.idaas.rest.jaxrs.OICExceptionMapper : [ No error code is available from the underlying exception ]" }
この項では、2-leggedモバイル・クライアント・フロー用のRESTコールについて説明します。詳細は、Oracle Fusion Middleware Oracle Access Management管理者ガイドのモバイルOAuth認可の理解に関する項を参照してください。
注意: すべての属性の名前および値では、大/小文字が区別されます。 |
この項では、次の項目について説明します。
curl -i --request GET 'http://host:port/ms_oauth/oauth2/endpoints /oauthservice/appprofiles/MobileApp1?device_os=iPhone%20OS&os_ver=7.000000'
ジェイルブレーク検出ポリシーのないHTTPレスポンス
{ "client_id":"MobileApp1", "mobileAppConfig":{ "claimAttributes":[ "oracle:idm:claims:client:geolocation", "oracle:idm:claims:client:imei", "oracle:idm:claims:client:jailbroken", "oracle:idm:claims:client:locale", "oracle:idm:claims:client:networktype", "oracle:idm:claims:client:ostype", "oracle:idm:claims:client:osversion", "oracle:idm:claims:client:phonecarriername", "oracle:idm:claims:client:phonenumber", "oracle:idm:claims:client:sdkversion", "oracle:idm:claims:client:udid", "oracle:idm:claims:client:vpnenabled", "oracle:idm:claims:client:fingerprint", "oracle:idm:claims:client:iosidforvendor", "oracle:idm:claims:client:iosidforad" ] }, "oauthAuthZService":"/ms_oauth/oauth2/endpoints/oauthservice/authorize", "oauthNotificationService":"/ms_oauth/oauth2/endpoints/oauthservice/push", "oauthTokenService":"/ms_oauth/oauth2/endpoints/oauthservice/tokens", "oracleMobileSecurityLevel":"LOW", "userConsentService":["/ms_oauth/resources/consentmanagement"], "userProfileService":["/ms_oauth/resources/userprofile"], "oracleConsentServiceProtection":"OAM" }
ジェイルブレーク検出ポリシーのあるHTTPレスポンス
{ "client_id":"ACMEStock", "jailBreakingDetectionPolicy": { "autoCheckPeriodInMin":60, "detectionLocation": [ {"action":"exists", "filePath":"/bin/bash", "success":true }, {"action":"exists", "filePath":"/Applications/Cydia.app", "success":true }, {"action":"exists", "filePath":"/Applications/limera1n.app", "success":true }, {"action":"exists", "filePath":"/Applications/greenpois0n.app", "success":true }, {"action":"exists", "filePath":"/Applications/blackra1n.app", "success":true }, {"action":"exists", "filePath":"/Applications/blacksn0w.app", "success":true }, {"action":"exists", "filePath":"/Applications/redsn0w.app", "success":true }, {"action":"exists", "filePath":"/Applications/sn0wbreeze.app", "success":true } ], "device_os":"iPhone OS", "os_ver":"7.000000", "policyExpirationInSec":3600 }, "mobileAppConfig": { "claimAttributes":[ "oracle:idm:claims:client:geolocation", "oracle:idm:claims:client:imei", "oracle:idm:claims:client:jailbroken", "oracle:idm:claims:client:locale", "oracle:idm:claims:client:networktype", "oracle:idm:claims:client:ostype", "oracle:idm:claims:client:osversion", "oracle:idm:claims:client:phonecarriername", "oracle:idm:claims:client:phonenumber", "oracle:idm:claims:client:sdkversion", "oracle:idm:claims:client:udid", "oracle:idm:claims:client:vpnenabled", "oracle:idm:claims:client:fingerprint", "oracle:idm:claims:client:iosidforvendor", "oracle:idm:claims:client:iosidforad" ] }, "oauthAuthZService":"/ms_oauth/oauth2/endpoints/oauthservice/authorize", "oauthNotificationService":"/ms_oauth/oauth2/endpoints/oauthservice/push", "oauthTokenService":"/ms_oauth/oauth2/endpoints/oauthservice/tokens", "oracleMobileSecurityLevel":"LOW", "userConsentService":["/ms_oauth/resources/consentmanagement"], "userProfileService":["/ms_oauth/resources/userprofile"], "oracleConsentServiceProtection":"OAM" }
この項では、デバイス登録のためのモバイル・クライアント検証コード用のRESTリクエストについて説明します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2 /endpoints/oauthservice/tokens -d 'grant_type=client_credentials &oracle_device_profile=<Base 64 Encoding Device Profile> &client_id=<MobileApp1> &oracle_requested_assertions=oracle-idm:/oauth/assertion-type/client-identity/ mobile-client-pre-authz-code-client'
レスポンス
{ "expires_in":300, "token_type":"Bearer", "oracle_tk_context":"pre_azc", "access_token":"eyJhbGciOiJg0LzJL...6LnHpAhcZA-EfJU9jQYH4GPINQXXd5_LsQy-D8TW_0Q" }
このリクエストは、モバイル・クライアント・アサーションおよびJWTユーザー・アサーションを作成します。JWTユーザー・アサーションはサーバー側のデバイス・ストアに格納されます。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2 /endpoints/oauthservice/tokens -d 'grant_type=password &username=userAbc123 &password=passwordAbc123 &client_id=<MobileApp1> &oracle_pre_authz_code=<Mobile Device Verification Code> &oracle_device_profile=<Base 64 Encoding Device Profile> &oracle_requested_assertions=urn:ietf:params:oauth: client-assertion-type:jwt-bearer'
レスポンス
{ "expires_in":3600, "token_type":"Bearer", "access_token":"eyJhbcOiJSzUxMIsInR5cCI6IkpX...OQN5mrZrl5pGyEJOMm4BSLQVVZhLsS5g" }
このリクエストは、サーバー側デバイス・キー・チェーンからJWTユーザー・アサーションを消去します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/oammsui/oauthservice/logout -d 'client_id=MobileApp1 &redirect_uri=mobileapp:// &oracle_device_profile=<Base 64 Encoding Device Profile> &client_assertion=<Mobile Client Assertion> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
レスポンス
HTTP/1.1 200 OK Date: Mon, 02 Dec 2013 22:55:37 GMT Content-Length: 0 Set-Cookie: JSESSIONID=z17tSdPLd7TG11dw7wNtTlJnzGXty3y3B8TqwW1GNvHjmzv6FqGv!535445357; path=/; HttpOnly X-ORACLE-DMS-ECID: 09edd9b26949554d:f4833c6:142b4da1082:-8000-000000000000277f X-Powered-By: Servlet/2.5 JSP/2.1
このリクエストは、サーバー側デバイス・キー・チェーンにJWTユーザー・アサーションを作成します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2 /endpoints/oauthservice/tokens -d 'grant_type=password &username=user123 &password=pwd456xyz &client_assertion=<MOBILE CLIENT ASSERTION> &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Ajwt-bearer &oracle_device_profile=<BASE 64 ENCODING DEVICE PROFILE> &oracle_requested_assertions=oracle-idm%3A%2Foauth%2Fassertion-type %2Fuser-identity%2Fjwt&oracle_use_server_device_store=true'
レスポンス
{"oracle_token_in_server_device_store":true, "expires_in":28800, "token_type":"Bearer", "oracle_tk_context":"user_assertion", "oracle_grant_type":"urn:ietf:params:oauth:grant-type:jwt-bearer", "access_token":""}
このリクエストは、サーバー側デバイス・ストアでJWTユーザー・アサーションが有効な場合、OAMユーザー・トークンおよびOAMマスター・トークンを作成します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" –request http://host:port/ms_oauth/oauth2/ endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &user_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Auser-assertion-type %3Ajwt-bearer &client_assertion=<MOBILE CLIENT ASSERTION> &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Ajwt-bearer &oracle_device_profile=<BASE 64 ENCODING DEVICE PROFILE> &oracle_use_server_device_store=true'
レスポンス
{"oracle_token_in_server_device_store":true, "oracle_aux_tokens": {"oam_mt": {"oracle_tk_context":"oam_mt", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/oam\/master-token", "access_token":"VERSION_4%7EDj10z62v9CQbnuX...Stid6XMhamU%2B" } }, "oracle_tk_context":"oam_ut", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/user-token\/oam", "access_token":"" }
このリクエストは、サーバー側デバイス・ストアでOAMユーザー・トークンが有効な場合、OAMアクセス・トークンおよびOAMマスター・トークンを作成します。次のリクエストにおいて、oracle_oam_application_resource
はWebGateに保護されたリソースで、oracle_oam_application_context
はWebGateによって生成された値であることに注意してください。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" –request http://host:port/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_use_server_device_store=true &user_assertion_type=oracle-idm:/oauth/assertion-type/user-identity/oam &client_assertion=<MOBILE CLIENT ASSERTION> &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Ajwt-bearer &oracle_device_profile=<BASE 64 ENCODING DEVICE PROFILE> &scope=oracle.security.oauth.oam.resource_access &oracle_oam_application_context=<WebGate generated value> &oracle_oam_application_resource=http%3A%2F%2Fhost.example.com %3A12884%2Findex.html'
レスポンス
{ "oracle_aux_tokens": {"oam_ut": {"oracle_token_in_server_device_store":true, "oracle_tk_context":"oam_ut", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/user-token\/oam", "access_token":"" } }, "oracle_tk_context":"oam_at", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/resource-access-token\/oam", "access_token":"3F62m7EDq%2FRMIwA16gUjg40DT43xDEik...xAViyc7XmzGIFBoBsNbbuN6SO1" }
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &username=alice &password=welcome &client_assertion=<MOBILE CLIENT ASSERTION> &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &oracle_device_profile=<BASE 64 ENCODING DEVICE PROFILE> &oracle_use_server_device_store=true &scope=UserProfile.users'
レスポンス
{ "expires_in":3600, "token_type":"Bearer", "access_token":"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCciO...iJSfkhhXLHhonktvigMCeI" }
この項では、3-leggedモバイル・クライアント・フロー用のRESTコールについて説明します。詳細は、Oracle Fusion Middleware Oracle Access Management管理者ガイドのOAuth 3-legged認可の理解に関する項およびモバイルOAuth認可の理解に関する項を参照してください。
注意: すべての属性の名前および値では、大/小文字が区別されます。 |
この項では、次の項目について説明します。
curl -i --request GET 'http://host:port/ms_oauth/oauth2/ endpoints/oauthservice/appprofiles/MobileApp1?device_os=iPhone%20OS&os_ver=7.000000'
ジェイルブレーク検出ポリシーのないレスポンス
{ "client_id":"MobileApp1", "mobileAppConfig":{ "claimAttributes":[ "oracle:idm:claims:client:geolocation", "oracle:idm:claims:client:imei", "oracle:idm:claims:client:jailbroken", "oracle:idm:claims:client:locale", "oracle:idm:claims:client:networktype", "oracle:idm:claims:client:ostype", "oracle:idm:claims:client:osversion", "oracle:idm:claims:client:phonecarriername", "oracle:idm:claims:client:phonenumber", "oracle:idm:claims:client:sdkversion", "oracle:idm:claims:client:udid", "oracle:idm:claims:client:vpnenabled", "oracle:idm:claims:client:fingerprint", "oracle:idm:claims:client:iosidforvendor", "oracle:idm:claims:client:iosidforad" ] }, "oauthAuthZService":"/ms_oauth/oauth2/endpoints/oauthservice/authorize", "oauthNotificationService":"/ms_oauth/oauth2/endpoints/oauthservice/push", "oauthTokenService":"/ms_oauth/oauth2/endpoints/oauthservice/tokens", "oracleMobileSecurityLevel":"LOW", "userConsentService":["/ms_oauth/resources/consentmanagement"], "userProfileService":["/ms_oauth/resources/userprofile"], "oracleConsentServiceProtection":"OAM" }
ジェイルブレーク検出ポリシーのあるレスポンス
{ "client_id":"ACMEStock", "jailBreakingDetectionPolicy": { "autoCheckPeriodInMin":60, "detectionLocation": [ {"action":"exists", "filePath":"/bin/bash", "success":true }, {"action":"exists", "filePath":"/Applications/Cydia.app", "success":true }, {"action":"exists", "filePath":"/Applications/limera1n.app", "success":true }, {"action":"exists", "filePath":"/Applications/greenpois0n.app", "success":true }, {"action":"exists", "filePath":"/Applications/blackra1n.app", "success":true }, {"action":"exists", "filePath":"/Applications/blacksn0w.app", "success":true }, {"action":"exists", "filePath":"/Applications/redsn0w.app", "success":true }, {"action":"exists", "filePath":"/Applications/sn0wbreeze.app", "success":true } ], "device_os":"iPhone OS", "os_ver":"7.000000", "policyExpirationInSec":3600 }, "mobileAppConfig": { "claimAttributes":[ "oracle:idm:claims:client:geolocation", "oracle:idm:claims:client:imei", "oracle:idm:claims:client:jailbroken", "oracle:idm:claims:client:locale", "oracle:idm:claims:client:networktype", "oracle:idm:claims:client:ostype", "oracle:idm:claims:client:osversion", "oracle:idm:claims:client:phonecarriername", "oracle:idm:claims:client:phonenumber", "oracle:idm:claims:client:sdkversion", "oracle:idm:claims:client:udid", "oracle:idm:claims:client:vpnenabled", "oracle:idm:claims:client:fingerprint", "oracle:idm:claims:client:iosidforvendor", "oracle:idm:claims:client:iosidforad" ] }, "oauthAuthZService":"/ms_oauth/oauth2/endpoints/oauthservice/authorize", "oauthNotificationService":"/ms_oauth/oauth2/endpoints/oauthservice/push", "oauthTokenService":"/ms_oauth/oauth2/endpoints/oauthservice/tokens", "oracleMobileSecurityLevel":"LOW", "userConsentService":["/ms_oauth/resources/consentmanagement"], "userProfileService":["/ms_oauth/resources/userprofile"], "oracleConsentServiceProtection":"OAM" }
この項では、デバイス登録のためのモバイル・クライアント検証コード用のRESTリクエストについて説明します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=client_credentials &oracle_device_profile=<Base 64 Encoding Device Profile> &client_id=<MobileApp1> &oracle_requested_assertions=oracle-idm:/oauth/assertion-type/client-identity/ mobile-client-pre-authz-code-client'
レスポンス
{ "expires_in":300, "token_type":"Bearer", "oracle_tk_context":"pre_azc", "access_token":"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCIsImt...5_LsQwlg7y-D8TW_0Q" }
デバイス登録用の認可コードをリクエストするために、ユーザー・エージェントは次のURLを使用します。認可サービスは、リダイレクションURIを使用してクライアントに認可コードを送信します。
http://host:port/ms_oauth/oauth2/endpoints/oauthservice/ authorize?client_id=MobileApp1&redirect_uri=<Mobile App URL Scheme> &response_type=code &oracle_requested_assertions=urn:ietf:params:oauth:client-assertion-type: jwt-bearer &oracle_pre_authz_code=<Mobile Device Client Verification Code >
レスポンス
<Mobile App URL Scheme>?code=eyJhbGciOiJSUzUxMiIsIns93I6...A0qenJQX5rrtRpdZJl50bS0
このリクエストは、モバイル・クライアント・アサーションおよびJWTユーザー・アサーションを作成します。JWTユーザー・アサーションはサーバー側のデバイス・ストアに格納されます。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=authorization_code &code=<Authorization Code for Device Registration> &client_id=<MobileApp1> &redirect_uri=<Mobile App URL Scheme> &oracle_device_profile=<Base 64 Encoding Device Profile>
レスポンス
{ "oracle_client_assertion_type":"urn:ietf:params:oauth:client-assertion-type:jwt-bearer", "expires_in":604800, "token_type":"Bearer", "oracle_tk_context":"client_assertion", "refresh_token":"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCIsImtpZCI6...7iEID1pLavdMsIg" }
この項では、デバイス登録のためのモバイル・クライアント検証コード(必要な場合)用のRESTリクエストについて説明します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:14100/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=client_credentials &oracle_device_profile=<Base 64 Encoding Device Profile> &client_id=<MobileApp1> &oracle_requested_assertions=oracle-idm:/oauth/assertion-type/client-identity /mobile-client-pre-authz-code-access'
レスポンス
{ "expires_in":300, "token_type":"Bearer", "oracle_tk_context":"pre_azc", "access_token":"eyJhbGciOiJSUzUxMiI4sInR5h4cCI6IkpXVCIsIm...NQXXd5_LsQy-D8TW_0Q" }
デバイス登録用の認可コードをリクエストするために、ユーザー・エージェントは次のURLを使用します。認可サービスは、リダイレクションURIを使用してクライアントに認可コードを送信します。
http://host.example.com:14100/ms_oauth/oauth2/endpoints/oauthservice/ authorize?client_id=MobileApp1&redirect_uri=<Mobile App URL Scheme> &response_type=code &scope=<Resource Scope> &oracle_pre_authz_code=<optional Mobile Device Client Verification Code>
レスポンス
<Mobile App URL Scheme>?code=eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVC...m_7FMwRXyEJI8J4JmPDf8RFdM7MP4_x3IBmK9amUAPRFJRNg
次のリクエストは、サーバー側デバイス・ストアでJWTユーザー・アサーションが有効な場合、OAuthアクセス・トークンを作成します。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:14100/ms_oauth/oauth2/endpoints /oauthservice/tokens -d 'grant_type=authorization_code &code=<Authorization Code for Access Token> &client_id=<MobileApp1> &redirect_uri=<Mobile App URL Scheme> &oracle_device_profile=<optional base 64 encoding device profile> &client_assertion=<Mobile Client Assertion> &client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer'
レスポンス
{ "expires_in":3600, "token_type":"Bearer", "refresh_token":"eyJhbGiiIsInR5cCI6IkpXVCmtaWRfdHlwZSI6IBfVUDM5Qi00Q0U3LUxyJ6ndU" }
この項では、OAMトークンの交換に使用するRESTコールについて説明します。
注意: すべての属性の名前および値では、大/小文字が区別されます。 |
この項では、次の項目について説明します。
この項では、クライアント資格証明をユーザー名およびパスワードとともに使用して、JWTユーザー・トークン、JWTアクセス・トークン、OAMユーザー・トークンおよびマスター・トークン、OAMアクセス・トークンのいずれかを取得する方法を説明します。
この項では、次の項目について説明します。
この項で示されているリクエストには、次の基本テンプレートが使用されています。
curl -i -H 'Authorization: Basic <sample client ID and password>' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/ endpoints/oauthservice /tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &username=<username> &password=<password> &oracle_requested_assertions=<Oracle_Requested_Assertion_Type> &oam_authen_resource=<oam_authen_resource>'
次の点に注意してください。
クライアントIDおよびパスワードの例は、以下の形式となっています。
userID123:password123
--> base 64 encoding -->
NTQzMjFpZDp3ZWxjb21lMQ==
実際のクライアントIDは、マシンが生成するGUIDになります。
次のアサーション・タイプを指定できます。
oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity%2Foam
oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity%2Fjwt
oam_authen_resource
オプション・パラメータを使用して、OAMサーバー側で構成される認証リソース名を指定します。
$ curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &username=user123 &password=passwordAbc12323 &oracle_requested_assertions= oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity%2Fjwt'
$ curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &username=user123 &password=passwordAbc123 &scope=ConsentManagement.retrieve ConsentManagement.grant ConsentManagement.revoke'
$ curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &username=user123 &password=passwordAbc123'
この項では、クライアント資格証明をoracle_user_credentials
の値とともに使用して、JWTユーザー・トークン、JWTアクセス・トークン、OAMユーザー・トークンおよびマスター・トークン、OAMアクセス・トークンのいずれかを取得する方法を説明します。
この項では、次の項目について説明します。
この項で示されているリクエストには、次の基本テンプレートが使用されています。
curl -i -H 'Authorization: Basic <sample client ID and password>' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<ORACLE_USER_CREDENTIALS> &oracle_requested_assertions=<Oracle_Requested_Assertion_Type> &oam_authen_resource=<oam_authen_resource>'
次の点に注意してください。
oracle_user_credentials
は次の形式をとります。
{"userid":"user123","password":"password123"}
>> JSONデータをBase64エンコードした値 >>
eyJ1c2VyaWQiOiJ3ZWJsb2dpYyIsInBhc3N3b3JkIjoid2VsY29tZTEifQ==
実際のクライアントIDは、マシンが生成するGUIDになります。
次のアサーション・タイプを指定できます。
oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity%2Foam
oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity%2Fjwt
oam_authen_resource
オプション・パラメータを使用して、OAMサーバー側で構成される認証リソース名を指定します。
$ curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=eyJ1c2VyaWQiOiJ3ZWJsb2dpYyIsInBhc3N3b3JkIjoid2VsY29tZT EifQ== &oracle_requested_assertions=oracle-idm%3A%2Foauth%2Fassertion-type%2F user-identity%2Fjwt'
$ curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=eyJ1c2VyaWQiOiJ3ZWJsb2dpYyIsInBhc3N3b3JkIjoid2VsY29t ZTEifQ== &scope=ConsentManagement.retrieve ConsentManagement.grant ConsentManagement.revoke'
$ curl -i -H 'Authorization: Basic NTQzMjFpZDp3ZWxjb21lMQ==' -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<base64_encoded_credential> &client_assertion=<client_jwt_assertion or client_saml2_assertion> &client_assertion_type=<client_assertion_type> &oracle_requested_assertions=<Oracle_Requested_Assertion_Type>'
この項では、JWTアサーションを使用して、JWTユーザー・トークン、JWTアクセス・トークン、OAMユーザー・トークンおよびマスター・トークン、OAMアクセス・トークンのいずれかを取得する方法を説明します。
この項では、次の項目について説明します。
この項で示されているリクエストには、次の基本テンプレートが使用されています。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host:port/ms_oauth/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &user_oracle_credentials=<base64_encoded_credentials> &client_assertion=eyJhbGciOiJSUzUxMiIsjiRZ1_3edKknPTCEtQS79h_44H_8VbGvnA6Dr3M0 &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Ajwt-bearer &oracle_requested_assertions=oracle-idm%3A%2Foauth%2Fassertion-type%2F user-identity%2Fjwt'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials& &user_assertion=<JWT User assertion Value> &user_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Auser-assertion-type%3Ajwt-bearer &client_assertion=eyJhbGciOiJSUzUxMiIsInR5cCI6Ik...j5mZJrfrwxgXxzwVcNbjRgi7uM8 &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &user_assertion=<JWT User assertion Value> &user_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Auser-assertion-type %3Ajwt-bearer &client_assertion=eyJhbGciOiJSUzUxMiIsInR5cCI6Ik...j5mZJrfrwxgXxzwVcNbjRgi7uM8 &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3A client-assertion-type%3Ajwt-bearer &oracle_device_profile=eyJvcmFjbGU6aWRtOmNsYWltczpjbGllbnQ6c2Rrd...1zOmNvc3ZlcnNpb24iOiI0LjAifQ== &oracle_use_server_device_store=true'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_use_server_device_store=true &user_assertion_type=oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity%2oam &client_assertion=eyJhbGciOiJSR5cCI6IkpXVCIsIm...UBaJkagXsLbqb_fNJHqNfwe3QCr7Uk &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &oracle_device_profile=eyJvcmFjbtczpjbGllbnQ6c2Rrdm...pc3ZlcnNpb24iOiI0LjAifQ== &scope=oracle.security.oauth.oam.resource_access &oracle_oam_application_context=dfsdfsdfsdfsdf &oracle_oam_application_resource=http%3A%2F%2Fhost123.example.com%3A12884%2Findex.html'
この項では、JWTユーザー・アサーションとPIN(またはPIN同様のユーザー資格証明)を使用して、OAMユーザー・トークンおよびOAMマスター・トークンを取得する方法について説明します。クライアントは、JWTユーザー・アサーションとともにPINまたはパスコード値(追加資格証明として)をリクエストに指定できます。
この項では、次の項目について説明します。
この項で示されているリクエストには、次の基本テンプレートが使用されています。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" –request http://host.example.com:14100/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<Base64 encoded PIN Value> &client_assertion=<JWT Client Assertion> &client_assertion_type= urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &oracle_user_credentials=<BASE64 ENCODED USER CREDENTIALS> &user_assertion_type= urn%3Aietf%3Aparams%3Aoauth%3Auser-assertion-type%3Ajwt-bearer &oracle_device_profile=<BASE64 ENCODING DEVICE PROFILE>'
oracle_user_credentials
パラメータはオプションです。任意の名前と値のペアを含むことができる、JSONデータのBase64エンコード値です。次に例を示します。
{"pin":"pinvalue123"}
はeyJwaW4iOiJwaW52YWx1ZTEyMyJ9
とエンコードされます
レスポンス
{ "oracle_aux_tokens":{ "oam_mt":{ "oracle_tk_context":"oam_mt", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/oam\/master-token", "access_token":"" } }, "oracle_tk_context":"oam_ut", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/user-token\/oam", "access_token":"" }
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" request http://host.us.example.com:14100/ms_oauth/oauth2/endpoints/oauthservice/tokens -d ' grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &user_assertion_type= urn%3Aietf%3Aparams%3Aoauth%3Auser-assertion-type%3Ajwt-bearer &oracle_user_credentials=eyJwaW4iOiJwaW52YWx1ZTEyMyJ9 &client_assertion=eyJhbGciOiJSUzI1NiIs...jOGVj0GXMCA &client_assertion_type= urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer &oracle_device_profile=ew0KICAgIm9yYWNsZTppZG0...fQ0K &user_assertion=eyJhbGciOiJSUzI1NiIsInR5...UyFT7Y9eeo5af4OA '
レスポンス
{ "oracle_aux_tokens": { "oam_mt": { "oracle_tk_context":"oam_mt", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/oam\/master-token", "access_token":"VERSION_4%7ELw3jGjxe...F6wouV7ow" } }, "oracle_tk_context":"oam_ut", "oracle_grant_type":"oracle-idm:\/oauth\/grant-type\/user-token\/oam", "access_token":"E6Fyeco+F0GgucHJuLmlkX3R5c...DC0dsLVdJYyJ3Su2xpZWB3"}
この項では、SAML2アサーションを使用して、JWTユーザー・トークン、JWTアクセス・トークン、OAMユーザー・トークンおよびマスター・トークン、OAMアクセス・トークンのいずれかを取得する方法を説明します。
この項では、次の項目について説明します。
この項で示されているリクエストには、次の基本テンプレートが使用されています。
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host123.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<base64_encoded_value> &client_assertion=<client_jwt_assertion or client_saml2_assertion> &client_assertion_type=<client_assertion_type> &oracle_requested_assertions=<Oracle_Requested_Assertion_Type>'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<base64_encoded_value> &client_assertion=PHNhbWw6QXNzZXJ0aW9uI...2ln%0AbmF0dXJltbDpBc3NlcnRpb24%2B%0A &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Asaml2-bearer &oracle_requested_assertions=oracle-idm%3A%2Foauth%2Fassertion-type %2Fuser-identity%2Fjwt'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<base64_encoded_value> &client_assertion=PHNhbWw6QXNzZXJ0aW9...uIHhtbG5zOnNhhbWwc3NlcnRpb24%2B%0A &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Asaml2-bearer&scope=ConsentManagement.retrieve'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &oracle_user_credentials=<base64_encoded_value> &client_assertion=PHNhbWw6QXNzZXJ0aW9uIHhtb9InVyb...2BPC9zYW1sOkF0dHJpYnV0ZT48 &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Asaml2-bearer'
この項では、モバイル・デバイス上のOAMユーザー・トークンおよびマスター・トークンまたはOAMアクセス・トークンの取得方法について説明します。
この項では、次の項目について説明します。
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=client_credentials &oracle_device_profile=eyJvcmFjbGU6aWRtOmNsYWltczpjbGllbnQ6c2RrdmVyc2l...OmNsaWVudDpvc3ZlcnNpb24iOiI0LjAifQ== &client_id=<MobileAgent1> &oracle_requested_assertions=oracle-idm%3A%2Foauth%2Fassertion-type %2Fclient-identity%2Fmobile-client-pre-authz-code-client'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/oauthservice/tokens -d 'grant_type=password&username=userAbc123 &password=passwordAbc123 &client_id=<MobileAgent1> &oracle_pre_authz_code=eyJhbGci...SsLRxbAt8Yl473vBACuH2Ms2fR_HwhQGVu_zgI3W3a_c &oracle_device_profile=eyJvcmFjbGU6aWRtOmNsYWl...G06Y2xhaW1zOmNsaWViI0LjAifQ== &oracle_requested_assertions=urn%3Aietf%3Aparams%3Aoauth %3Aclient-assertion-type%3Ajwt-bearer'
$ curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth9%2Fgrant-type%2Foam_credentials &user_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Auser-assertion-type%3Ajwt-bearer &client_assertion=eyJhbGciOiJSUzUxMiIsInR5cCI...qwzcgoh5t7sfZInGkbprlA5UswMzqk &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Ajwt-bearer &oracle_device_profile=eyJvcmFjbGU6aWRtOmNsYWltczpjbG...udDnNpb24iOiI0LjAifQ== &oracle_use_server_device_store=true'
curl -i -H "Content-Type: application/x-www-form-urlencoded;charset=UTF-8" --request POST http://host.example.com:18001/ms_oauth/oauth2/endpoints/ oauthservice/tokens -d 'grant_type=oracle-idm%3A%2Foauth%2Fgrant-type%2Foam_credentials &client_assertion=eyJhbGciOiJSUzUxMiIs...6NxPv0x_Ng2pEcjVJf42p-tiBFClavI56ycCg &client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type %3Ajwt-bearer &oracle_device_profile=eyJvcmFjbGU64czpjbGllbnQ6c...ivc3ZlcnNpb24iOiI0LjAifQ== &user_assertion_type=oracle-idm%3A%2Foauth%2Fassertion-type%2Fuser-identity %2Foam &scope=oracle.security.oauth.oam.resource_access &oracle_oam_application_context=fdsfsdfsdfsdf &oracle_oam_application_resource=http%3A%2F%2Fhost123.example.com %3A12884%2Findex.html &oracle_use_server_device_store=true'