機械翻訳について

Identity Cloud Serviceを使用したセキュアなWebサービス

Oracle Identity Cloud ServiceおよびOracle Web Services Managerを使用して、Oracle WebLogic Server for OCIドメインにデプロイするwebサービス・アプリケーションおよびクライアントを保護します。

この構成は、Oracle WebLogic Server for OCIで作成し、次のすべての要件を満たすドメインにのみ適用できます:

すべてのJRF対応ドメインにはOracle Web Services Manager (OWSM)が含まれており、組織全体でwebサービスを一貫して管理および保護するためのポリシー・フレームワークが提供されます。 Oracle Web Services ManagerとOracle Identity Cloud Serviceの両方で、OAuthプロトコルがサポートされています。 webサービス・クライアントは、許可サーバー(Oracle Identity Cloud Service)で認証して許可権限を提示することで、アクセス・トークンをリクエストします。 Oracle Web Services Managerサーバー側エージェントは、アクセス・トークンを検証し、有効な場合はクライアント・リクエストを受け入れます。

「Oracle Web Services Managerを使用したWebサービスの保護とポリシーの管理」「Oracle Web Services ManagerでのOAuth2の使用」を参照してください。

webサービス通信を保護する場合は、次の用語が使用されます:

  • 「プロバイダ」 - webサービス・アプリケーションをホストするOracle WebLogic Server for OCIスタック(WebLogic Serverドメイン、ロード・バランサなど)。
  • 「クライアント」 - webサービス・クライアント・アプリケーションをホストするOracle WebLogic Server for OCIスタック。

次の図は、このセキュリティ構成を示しています。

architecture_idcs_owsm_diagram.pngの説明は以下のとおりです
「図architecture_idcs_owsm_diagram.pngの説明」

サンプルWebサービス・クライアント・アプリケーションのデプロイ

Oracle Web Services ManagerとOracle Identity Cloud Serviceの間のOAuth統合をすばやく確認するには、サンプル・クライアント・アプリケーションを構築してデプロイします。

このサンプルwebアプリケーションは、HTMLフォームを含む1つのページと、指定されたWebサービスURLを起動する1つのサーブレットで構成されています。 クライアントは、OAuthポリシーoracle/http_oauth2_token_over_ssl_idcs_client_policyを使用します。

または、独自のwebサービスのクライアント・アプリケーションをデプロイおよびテストできます。

  1. opcユーザーとして、クライアント・ドメインの管理サーバー・ノードに接続します。
    ssh -i <path_to_private_key> opc@<node_public_ip>
  2. oracleユーザーに変更します。
    sudo su - oracle
  3. webアプリケーションのディレクトリ構造を作成します。
    mkdir -p /home/oracle/oauth-client/WEB-INF/classes
  4. 次のテキストをコピーして、/home/oracle/oauth-client/index.jspという名前の新しいファイルに貼り付けます。
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html"/>
        <title>Test web services call using wss-oauth</title>
    </head>
    <body>
    <form name="oauth-test" method="post" action="helloworldclientservlet">
        <table>
            <tr>
                <th>Address</th>
                <td>
                    <input name="address" type="text" size="110" value=""/>
                </td>
            </tr>
            <tr>
                <th>Scope</th>
                <td>
                    <input name="scope" type="text" size="110" value=""/>
                </td>
            </tr>
            <tr>
                <th>Test</th>
                <td>
                    <input name="submit" type="submit" size="20" value="Test"/>
                </td>
            </tr>
        </table>
    </form>
    </body>
    </html>
  5. 次のテキストをコピーして、/home/oracle/HelloWorldClientServlet.javaという名前の新しいファイルに貼り付けます。
    import java.util.*;
    import java.io.*;
    import java.lang.*;
    import java.security.AccessController;
    import javax.security.auth.Subject;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import weblogic.jaxrs.api.client.Client;
    import com.sun.jersey.api.client.WebResource;
    import com.sun.jersey.api.client.config.DefaultClientConfig;
    import com.sun.jersey.api.client.filter.LoggingFilter;
    import com.sun.jersey.api.client.ClientResponse;
    import oracle.wsm.metadata.feature.AbstractPolicyFeature;
    import oracle.wsm.metadata.feature.PolicyReferenceFeature;
    import oracle.wsm.metadata.feature.PolicySetFeature;
    import oracle.wsm.metadata.feature.PropertyFeature;
    import oracle.wsm.security.util.SecurityConstants;
    
    public class HelloWorldClientServlet extends HttpServlet {
        @Override
        protected void doPost(HttpServletRequest request,
                              HttpServletResponse response) throws ServletException, IOException {
            response.setContentType("text/plain");
            PrintWriter out = response.getWriter();
            String BASE_URI = request.getParameter("address");
            String SCOPE_URI = request.getParameter("scope");
            PropertyFeature scope = new PropertyFeature(SecurityConstants.ConfigOverride.CO_SCOPE, SCOPE_URI);
            PolicyReferenceFeature clientPRF = new PolicyReferenceFeature("oracle/http_oauth2_token_over_ssl_idcs_client_policy", scope);
            DefaultClientConfig cc = new DefaultClientConfig();
            Map<String, Object> properties = cc.getProperties();
            properties.put(AbstractPolicyFeature.ABSTRACT_POLICY_FEATURE, new PolicySetFeature(clientPRF));
            Client client = Client.create(cc);
            OutputStream baos = new ByteArrayOutputStream();
            PrintStream ps = new PrintStream(baos);
            client.addFilter(new LoggingFilter(ps));
            try {
                Subject subject = Subject.getSubject(AccessController.getContext());
                Set<java.security.Principal> principals = subject.getPrincipals();
                for (java.security.Principal principal : principals) {
                    out.println("principal : " + principal.toString());
                }
                WebResource webResource = client.resource(BASE_URI);
                ClientResponse res = webResource.get(ClientResponse.class);
                ps.flush();
                out.println(baos.toString());
            } catch (Exception e) {
                String[] messages = getAllInnerErrorMessages(e);
                int count = 0;
                String allMsg = null;
                for (String mes : messages) {
                    if (count != 0) {
                        allMsg += "\n|";
                        allMsg = allMsg + "\n+" + (getString("-", count * 3) + "-> Caused By : " + mes);
                    } else {
                        allMsg = mes;
                    }
                    count++;
                }
                out.println("The client was not able to call the service using OAuth. The exception causes are: \n" + allMsg);
            }
            out.close();
        }
     
        private String[] getAllInnerErrorMessages(Throwable th) {
            List<String> all = new ArrayList<String>();
            boolean msgFound = false;
            while (th != null) {
                if (th.getMessage() != null && !th.getMessage().trim().equals("")) {
                    if (!msgFound && all.size() > 0) {
                        all.add(0, th.getMessage());
                    }
                    all.add(th.getMessage());
                    msgFound = true;
                } else {
                    all.add(th.getClass().getName());
                }
                th = th.getCause();
            }
            return all.toArray(new String[0]);
        }
     
        private String getString(String sp, int count) {
            StringBuffer ret = new StringBuffer();
            for (int i = 0; i < count; i++) {
                ret.append(sp);
            }
            return ret.toString();
        }
     
    }
  6. 次のテキストをコピーして、/home/oracle/oauth-client/WEB-INF/web.xmlという名前の新しいファイルに貼り付けます。
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5" xmlns="http://java.sun.com/xml/ns/javaee">
        <servlet>
            <servlet-name>HelloWorldClientServlet</servlet-name>
            <servlet-class>HelloWorldClientServlet</servlet-class>
        </servlet>
        <servlet-mapping>
            <servlet-name>HelloWorldClientServlet</servlet-name>
            <url-pattern>/helloworldclientservlet</url-pattern>
        </servlet-mapping>
        <security-constraint>
            <web-resource-collection>
                <web-resource-name>Success</web-resource-name>
                <url-pattern>/index.jsp</url-pattern>
            </web-resource-collection>
        </security-constraint>
        <login-config>
            <auth-method>CLIENT-CERT</auth-method>
        </login-config>
        <welcome-file-list>
            <welcome-file>index.jsp</welcome-file>
        </welcome-file-list>
    </web-app>
  7. setWLSEnv.shを実行します。
    source /u01/app/oracle/middleware/wlserver/server/bin/setWLSEnv.sh
  8. サーブレットをコンパイルし、クラス・ファイルを/home/oracle/oauth-client/WEB-INF/classesに置きます。
    cd /home/oracle
    javac -cp $CLASSPATH:/u01/app/oracle/middleware/oracle_common/modules/clients/com.oracle.webservices.wls.jaxws-owsm-client.jar \
    -d /home/oracle/oauth-client/WEB-INF/classes \
    HelloWorldClientServlet.java
  9. アプリケーションをパッケージ化します。
    cd oauth-client
    zip -r ../oauth-client.war *
    cd ..
  10. oauth-client.warをドメインにデプロイするには、WebLogic Scripting Tool (WLST)を使用します。
    /u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh
    connect('<admin_user>','<admin_password>','t3://<admin_server_IP>:<admin_server_port>')
    deploy(appName='oauth-client',path='/home/oracle/oauth-client.war',targets='<server_or_cluster>',upload='true')

    例:

    /u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh
    connect('weblogic','<admin_password>','t3://203.0.113.20:7001')
    deploy(appName='oauth-client',path='/home/oracle/oauth-client.war',targets='wlsoci_cluster',upload='true')

Identity Cloud Serviceの情報の取得

Oracle Identity Cloud Serviceインスタンスに関する構成詳細を記録し、その証明書もダウンロードします。

開始する前に、webサービス・クライアント・ドメイン用に作成されたOracle Identity Cloud Service内の機密アプリケーションを識別します。 「Oracle Identity Cloud Serviceのアイデンティティ・リソース」を参照してください。

  1. Oracle Identity Cloud Serviceコンソールにアクセスします。
  2. ナビゲーション・メニューで、「アプリケーション」をクリックします。
  3. クライアント・ドメインに作成された機密アプリケーションをクリックします。
  4. 「構成」タブをクリックします。
  5. 一般情報で「クライアントID」をコピーします。
  6. 「シークレットの表示」をクリックして、シークレットの値をコピーします。
  7. ナビゲーション・メニューで、「設定」をクリックしてから「デフォルト設定」をクリックします。
  8. まだ有効になっていない場合は、「アクセス署名証明書」を選択し、「保存」をクリックしてからYesをクリックします。
  9. 次のURLにアクセス : https://idcs-GUID.identity.oraclecloud.com/admin/v1/SigningCert/jwk

    Oracle Identity Cloud ServiceインスタンスのGUIDは、コンソールURLから取得できます。

    レスポンスには、カンマで区切られた2つの証明書が含まれます。

    {"keys":[{"kty":"RSA",...,"kid":"SIGNING_KEY",...:
    ["<idcs_cert>","<idcs_root_ca_cert>"],"key_ops":
    ["verify","encrypt"],"alg":"RS256",...}]}
  10. 最初の証明書idcs_certをコピーして、idcs.certという新しいファイルに貼り付けます。
    標準証明書ヘッダーとフッターの行を追加します。
    -----BEGIN CERTIFICATE-----
    <idcs-cert>
    -----END CERTIFICATE-----
  11. 2つ目の証明書idcs_root_ca_certをコピーして、idcs_ca.certという新しいファイルに貼り付けます。
    標準証明書ヘッダーとフッターの行を追加します。
    -----BEGIN CERTIFICATE-----
    <idcs_root_ca_cert>
    -----END CERTIFICATE-----
  12. opensslを使用して、idcs.certをテキスト形式で表示します。
    openssl x509 -in idcs.cert -text
  13. 識別名(DN)のリストを含むSubjectフィールドの内容をコピーします。
    Certificate:
        Data:
            ...
            Validity
                Not Before: Aug 27 09:20:19 2019 GMT
                Not After : Aug 27 09:20:19 2029 GMT
            Subject: <dn_list>
            ...
  14. opensslを使用して、テキスト形式でidcs_ca.certを表示し、検証エラーがないことを確認します。
    openssl x509 -in idcs_ca.cert -text
  15. 次のURLにアクセス : https://idcs-GUID.identity.oraclecloud.com/.well-known/idcs-configuration
  16. レスポンスから、issuerおよびtoken_endpointの値をコピーします。
    たとえば:
    {
      ...
      "openid-configuration" : {
        "issuer" : "https://identity.oraclecloud.com/",
        "authorization_endpoint" : "https://idcs-GUID.identity.oraclecloud.com/oauth2/v1/authorize",
        "token_endpoint" : "https://idcs-GUID.identity.oraclecloud.com/oauth2/v1/token",
        ...
  17. Oracle Identity Cloud Serviceコンソールに戻り、「設定」をクリックしてから、「デフォルト設定」をクリックします。
  18. 「アクセス署名証明書」が以前に無効にされていた場合は、再度無効にします。 「保存」Yesの順にクリックします。

Webサービス・プロバイダ用のOAuthの構成

証明書をインポートし、グローバル・ポリシー・アタッチメントを作成することによって、プロバイダ・ドメインのOracle Web Services ManagerとOracle Identity Cloud Service間の信頼を確立します。

グローバル・ポリシーは、このドメインにデプロイされるすべてのwebサービスに影響します。 または、個々のwebサービスのポリシーを作成できます。

  1. ファイル、idcs.certおよびidcs_ca.certを、プロバイダ・ドメイン内の管理サーバー・ノードにopcユーザーとしてコピーします。
    ファイルを/tmpディレクトリに置きます。
    scp -i <path_to_private_key> idcs.cert opc@<node_public_ip>:/tmp
    scp -i <path_to_private_key> idcs_ca.cert opc@<node_public_ip>:/tmp
  2. opcユーザーとしてドメインの管理サーバー・ノードに接続します。
    ssh -i <path_to_private_key> opc@<node_public_ip>
  3. 証明書ファイルの所有者をoracleに変更します。
    sudo chown oracle:oracle /tmp/*.cert
  4. oracleユーザーに変更します。
    sudo su - oracle
  5. 次のテキストをコピーして、config_owsm_provider.pyという名前の新しいファイルに貼り付けます。
    ip='<admin_server_IP>'
    port='<admin_server_port>'
    user='<admin_user>'
    pwd='<password>'
    dn_list='<idcs_dn_list>'
    trusted_issuer='<issuer>'
    idcs_cert_path = '/tmp/idcs.cert'
    idcs_ca_cert_path = '/tmp/idcs_ca.cert'
  6. config_owsm_provider.pyの変数を更新します。
    • このノードのIPアドレス
    • 管理サーバーのポート番号(デフォルトは7001)
    • ドメイン管理者のユーザー名とパスワード
    • idcs.certのサブジェクト・フィールドからの識別名(DN)。
    • Oracle Identity Cloud Service発行者名

    DNエントリの順序を逆にします。 たとえば、CN = abc,CN = defCN = def,CN = abcに変更します。

    たとえば:

    ip='203.0.113.20'
    port='7001'
    user='weblogic'
    pwd='<password>'
    dn_list='CN=idcs-GUID,CN=Cloud9,CN=sslDomains'
    trusted_issuer='https://identity.oraclecloud.com/'
    
  7. 次のテキストをconfig_owsm_provider.pyおよび変数宣言の後ろにコピーして貼り付けます。
    connect(user, pwd,'t3://' + ip + ':' + port)
    
    try:
       beginWSMSession()
       createWSMPolicySet('oauth-ps-ws-service','ws-service','Domain("*")','Global policy for default interactions for ws-service',true)
       attachWSMPolicy('oracle/wss11_saml_or_username_token_with_message_protection_service_policy')   
       validateWSMPolicySet('oauth-ps-ws-service')
       displayWSMPolicySet('oauth-ps-ws-service')
    finally:
       commitWSMSession()
    
    try:
       beginWSMSession()
       createWSMPolicySet('oauth-ps-rest-resource','rest-resource','Domain("*")','Global policy for default interactions for rest-resource',true)
       attachWSMPolicy('oracle/multi_token_over_ssl_rest_service_policy')
       validateWSMPolicySet('oauth-ps-rest-resource')
       displayWSMPolicySet('oauth-ps-rest-resource')
    finally:
       commitWSMSession()
    
    try:
       beginWSMSession()
       createWSMTokenIssuerTrustDocument('trust-doc',None)
       setWSMConfiguration(None, 'TokenIssuerTrust', 'name', None, ['trust-doc'])
       selectWSMTokenIssuerTrustDocument('trust-doc')
       setWSMTokenIssuerTrust('dns.jwt',trusted_issuer,[dn_list])
       setWSMTokenIssuerTrust('dns.sv',trusted_issuer,[dn_list])
       setWSMTokenIssuerTrust('dns.hok',trusted_issuer,[dn_list])
       setWSMTokenIssuerTrust('dns.jwt','www.oracle.com',[])
       setWSMTokenIssuerTrust('dns.sv','www.oracle.com',[])
       setWSMTokenIssuerTrust('dns.hok','www.oracle.com',[])
    finally:
       commitWSMSession()
    
    refreshWSMCache()
    
    svc=getOpssService(name='KeyStoreService')
    try:
       svc.createKeyStore(appStripe='owsm', name='keystore', password='',permission=true)
    except Exception, ex:
       ex_msg = str(ex)
       if 'Keystore keystore in stripe owsm already exists' in ex_msg:
          print 'Keystore keystore in stripe owsm already exists. Continue...'
       else:
          raise
    svc.importKeyStoreCertificate(appStripe='owsm', name='keystore', password='', alias='idcs-oauthkey', keypassword='', type='TrustedCertificate', filepath=idcs_cert_path)
    svc.importKeyStoreCertificate(appStripe='owsm', name='keystore', password='', alias='idcs-oauthkeyca', keypassword='', type='TrustedCertificate', filepath=idcs_ca_cert_path)
  8. WLSTを使用してconfig_owsm_provider.pyを実行します。
    /u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh config_owsm_provider.py

    スクリプトが正常に実行されたことを確認します:

    ...
    Session started for modification.
    The policy set was created successfully in the session.
    Policy reference "oracle/wss11_saml_or_username_token_with_message_protection_service_policy" added.
    ...
    Creating policy set oauth-ps-ws-service in repository.
    Session committed successfully.
    Session started for modification.
    The policy set was created successfully in the session.
    Policy reference "oracle/multi_token_over_ssl_rest_service_policy" added.
    ...
    Creating policy set oauth-ps-rest-resource in repository.
    Session committed successfully.
    Session started for modification.
    New Token Issuer Trust document named trust-doc created.
    ...
    Creating tokenissuertrust trust-doc in repository.
    Session committed successfully.
    ...
    Keystore created
    Certificate imported.
    Certificate imported.

Webサービス・プロバイダの機密アプリケーションの更新

Oracle Identity Cloud Serviceにあるドメイン機密アプリケーションでOAuthによって保護されているリソースを更新します。

  1. Oracle Identity Cloud Serviceコンソールにアクセスします。
  2. ナビゲーション・メニューで、「アプリケーション」をクリックします。
  3. プロバイダ・ドメイン用に作成された機密アプリケーションをクリックします。
  4. 「構成」タブをクリックします。
  5. リソースで、「リソースの登録」をクリックします。
  6. 「主な読者」の場合、プロバイダ・ドメインにトラフィックをダイレクトするロード・バランサのURLを入力します。
    https://<lb_public_ip>:443
  7. 「スコープ」の場合は、「追加」をクリックします。
  8. 新しいスコープの名前をexternalに設定して、「追加」をクリックします。
  9. 「保存」をクリックします。

Webサービス・クライアント用のOAuthの構成

証明書をインポートし、グローバル・ポリシー・アタッチメントを作成することによって、クライアント・ドメインおよびOracle Identity Cloud ServiceでOracle Web Services Manager間の信頼を確立します。

グローバル・ポリシーは、このドメインにデプロイされているすべてのwebサービス・クライアントに影響します。 または、個々のアプリケーションのポリシーを作成できます。

  1. opcユーザーとして、クライアント・ドメインの管理サーバー・ノードに接続します。
    ssh -i <path_to_private_key> opc@<node_public_ip>
  2. oracleユーザーに変更します。
    sudo su - oracle
  3. 次のテキストをコピーして、config_owsm_client.pyという名前の新しいファイルに貼り付けます。
    def config_policyset(policy_set_name,subject_type):
        try:
            beginWSMSession()
            createWSMPolicySet(policy_set_name,subject_type,resource_scope,desc,is_enabled)
            attachWSMPolicy(policy)
            setWSMPolicyOverride(policy,'token.uri',token_uri)
            setWSMPolicyOverride(policy,'oauth2.client.csf.key',csf_key)
            validateWSMPolicySet(policy_set_name)
        finally:
            commitWSMSession()
            displayWSMPolicySet(policy_set_name)
     
    ip='<admin_server_IP>'
    port='<admin_server_port>'
    user='<admin_user>'
    pwd='<password>'
    client_id='<idcs_app_client_id>'
    client_secret='<idcs_app_client_secret>'
    token_uri = '<token_endpoint>'
    dn_list = '<dn_list>'
    app_resource = 'resource=<client_app_name>'
  4. config_owsm_client.pyの変数を更新します。
    • このノードのIPアドレス
    • 管理サーバーのポート番号(デフォルトは7001)
    • ドメイン管理者のユーザー名とパスワード
    • ドメイン用に作成された、Oracle Identity Cloud Service内の機密アプリケーションのクライアントIDおよびシークレット
    • Oracle Identity Cloud Serviceトークン・エンドポイント
    • Oracle Web Services Managerで生成された証明書に使用する識別名(DN)
    • ドメインにデプロイされるwebサービス・クライアント・アプリケーションの名前

    たとえば:

    ip='203.0.113.30'
    port='7001'
    user='weblogic'
    pwd='<password>'
    client_id='ABCD1234efgh5678IJKL9012'
    client_secret='<idcs_app_client_secret>'
    token_uri = 'https://idcs-1234abcd5678EFGH9012ijkl.identity.oraclecloud.com/oauth2/v1/token'
    dn_list = 'CN=OWSM, OU=ST, O=Oracle, L=RedWood, ST=CA, C=US'
    app_resource = 'resource=oauth-client'
  5. 次のテキストをconfig_owsm_client.pyおよび変数宣言の後ろにコピーして貼り付けます。
    connect(user, pwd,'t3://' + ip + ':' + port)
    
    csf_key = 'idcs.oauth2.client.credentials'
    createCred(map='oracle.wsm.security',key=csf_key,user=client_id,password=client_secret)
    
    is_enabled = true
    policy = 'oracle/oauth2_config_client_policy'
    resource_scope = 'Domain("*")'
    desc = ''
    config_policyset('oauth-ps-config-rest-connection','rest-connection')
    config_policyset('oauth-ps-config-rest-client','rest-client')
    config_policyset('oauth-ps-config-ws-connection','ws-connection')
    config_policyset('oauth-ps-config-ws-client','ws-client')
    config_policyset('oauth-ps-config-ws-callback','ws-callback')
    refreshWSMCache()
    
    svc = getOpssService(name='KeyStoreService')
    try:
       svc.createKeyStore(appStripe='owsm', name='keystore', password='',permission=true)
    except Exception, ex:
       ex_msg = str(ex)
       if 'Keystore keystore in stripe owsm already exists' in ex_msg:
          print 'Keystore keystore in stripe owsm already exists. Continue...'
       else:
          raise
    svc.generateKeyPair(appStripe='owsm', name='keystore', password='', dn=dn_list, keysize='2048', alias='orakey', keypassword='')
     
    svc.exportKeyStoreCertificate(appStripe='owsm', name='keystore', password='', alias='orakey', keypassword='', type='TrustedCertificate', filepath='/tmp/orakey.cert')
    
    grantPermission(appStripe=None, codeBaseURL='file:${common.components.home}/modules/oracle.wsm.common/wsm-agent-core.jar',principalClass=None,principalName=None,permClass='oracle.wsm.security.WSIdentityPermission',permTarget=app_resource, permActions='assert')
    
  6. WLSTを使用してconfig_owsm_client.pyを実行します。
    /u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh config_owsm_client.py

    スクリプトが正常に実行されたことを確認します:

    ...
    Credential created successfully.
    Session started for modification.
    The policy set was created successfully in the session.
    Policy reference "oracle/oauth2_config_client_policy" added.
    ...
    Creating policy set oauth-ps-config-rest-connection in repository.
    Session committed successfully.
    ...
    Session started for modification.
    The policy set was created successfully in the session.
    Policy reference "oracle/oauth2_config_client_policy" added.
    ...
    Creating policy set oauth-ps-config-rest-client in repository.
    Session committed successfully.
    ...
    Keystore created
    Key pair generated
    Certificate exported.
  7. 生成された証明書ファイルの所有者をopcユーザーに変更します。
    exit
    sudo chown opc:opc /tmp/orakey.cert
  8. opcユーザーとして証明書ファイルをダウンロードします。
    scp -i <path_to_private_key> opc@<node_public_ip>:/tmp/orakey.cert .

Webサービス・クライアントの機密アプリケーションの更新

Oracle Web Services Manager証明書を、Oracle Identity Cloud Serviceにあるドメインの機密アプリケーションにインポートします。

  1. Oracle Identity Cloud Serviceコンソールにアクセスします。
  2. ナビゲーション・メニューで、「アプリケーション」をクリックします。
  3. クライアント・ドメインに作成された機密アプリケーションをクリックします。
  4. 「構成」タブをクリックします。
  5. クライアント構成で、「クライアント・タイプ」「信頼」を選択します。
  6. 「証明書」の場合は、「インポート」をクリックします。
  7. 「証明書別名」の場合は、一意の名前を入力します。
    たとえば、orakey_oauthclient
  8. orakey.certファイルを選択し、「インポート」をクリックします。
  9. 「スコープの追加」をクリックします。
  10. webサービス・プロバイダであるドメインの機密アプリケーションを選択し、「追加」をクリックします。
  11. 「保存」をクリックします。

サンプルWebサービス・クライアントのテスト

サンプル・クライアント・アプリケーションをデプロイした場合は、それを使用してOracle Web Services ManagerとOracle Identity Cloud Service間のOAuth統合をすばやく検証できます。

  1. ロード・バランサを使用して、クライアント・ドメイン上のサンプル・アプリケーションにアクセスします。
    https://<client_lb_public_ip>/oauth-client
  2. 「アドレス」には、webサービス・プロバイダのURLを入力します。
    https://<provider_lb_public_ip>/<service_endpoint>

    たとえば:

    https://203.0.113.21/myapp/myservice
  3. 「スコープ」の場合、この値を入力します。
    https://<provider_lb_public_ip>:443external

    たとえば:

    https://203.0.113.21:443external
  4. 「テスト」ボタンをクリックします。