OAMアプリケーション構成およびOracle GoldenGate認可プロファイルの例

次のスクリプトは、セキュアなOracle Access Manager (OAM)アプリケーションを作成する際に、様々なコンポーネントを構成する例です。

アイデンティティ・ドメインの作成

次の例は、OAMでのアイデンティティ・ドメインの作成を示しています。
curl -x "" 
     -u 'weblogic:weblogic1' 
       'http://east.oraclevcn.com:18585/oam/services/rest/ssa/api/v1/oauthpolicyadmin/oauthidentitydomain' 
     -H 'Content-Type: application/json' 
     -d '
        {"name": "OGGDomain1"
        ,"identityProvider": "OUD"
        ,"description": "Test Domain"
        , "tokenSettings":
           [{"tokenType": "ACCESS_TOKEN"
	  ,"tokenExpiry": 3600
	  ,"lifeCycleEnabled": false
	  ,"refreshTokenEnabled": false
	  ,"refreshTokenExpiry": 86400
	  ,"refreshTokenLifeCycleEnabled": false
            }
	 ,{"tokenType": "AUTHZ_CODE"
	  ,"tokenExpiry": 3600
	  ,"lifeCycleEnabled":false
	  ,"refreshTokenEnabled": false
	  ,"refreshTokenExpiry": 86400
	  ,"refreshTokenLifeCycleEnabled": false
	  }
	 ,{"tokenType": "SSO_LINK_TOKEN"
	  ,"tokenExpiry": 3600
	  ,"lifeCycleEnabled": false
	  ,"refreshTokenEnabled": false
	  ,"refreshTokenExpiry":86400
	  ,"refreshTokenLifeCycleEnabled": false
	  }
	 ]
       ,"errorPageURL": " http://east.oraclevcn.com:2222/oam/pages/servererror.jsp"
       ,"consentPageURL":"http://east.oraclevcn.com:2222/oam/pages/consent.jsp"
       ,"customAttrs": null
       }'

リソース・サーバーの作成

次の例は、OAMアプリケーションのリソース・サーバーの作成を示しています。
curl -x "" 
     -u weblogic:weblogic1 
     -H "Content-Type: application/json" '
	http://east.oraclevcn.com:18585/oam/services/rest/ssa/api/v1/oauthpolicyadmin/application' 
     -X POST 
     -d '
        {"idDomain":"OGGDomain1"
        ,"name":"OGGResourceServerCorrect"
        ,"scopes":
        [{"scopeName":"oggServiceToService"
         ,"description":"test ogg urn scope"
        }]
        }'

アプリケーションの作成

次の例は、いくつかのリダイレクトURIを含む、OAMを使用したアプリケーションの作成を示しています。
curl -x "" 
     -v 
     -u weblogic:<weblogicpwd> 
     -H "Content-Type: application/json" 
       'http://east.oraclevcn.com:18585/oam/services/rest/ssa/api/v1/oauthpolicyadmin/client'    
     -X POST 
     -d '
        {"secret":"OGGClient1Secret"
        ,"id":"OGGClientID1"
        ,"scopes":["OGGResourceServerCorrect.oggServiceToService"]
        ,"clientType":"CONFIDENTIAL_CLIENT"
        ,"idDomain":"OGGDomain1"
        ,"description":"Client Description"
        ,"name":"OGGClientCorrect"
        ,"grantTypes":["PASSWORD", "CLIENT_CREDENTIALS", "AUTHORIZATION_CODE"]
        ,"defaultScope":"OGGResourceServerCorrect.oggServiceToService"
        ,"redirectURIs":
          [{"url":"https://localhost:9010/services/v2/authorization", "isHttps":true}
          ,{"url":"https://west.oraclevcn.com:9010/services/v2/authorization", "isHttps":true}
          ,{"url":"https://west.oraclevcn.com:9001/services/v2/authorization", "isHttps":true}
          ,{"url":"https://localhost:9001/services/v2/authorization", "isHttps":true}
          ]
         ,"attributes":[{"attrName":"OGGGroups"
         ,"attrValue":"${user.groups}"
         ,"attrType":"STATIC"
         }'

Oracle GoldenGateでのOAMアプリケーション用の認可プロファイルの作成

次のコード・スニペットは、Oracle GoldenGateで(cURLを使用して)OAMアプリケーション用の認可プロファイルを作成する方法のサンプルです。
curl -k 
     -u ggma:<ggmapwd> 
     -X POST 
     -d '{"type":"oam"
         ,"clientID":"OGGClientID1"
         ,"clientSecret":"OGGClient1Secret"
         ,"tenantDiscoveryURI":"http://east.oraclevcn.com:2222/.well-known/openid-configuration"
         ,"groupToRoles":{"securityGroup":"fusionapps_gg_prod_sec"
                         ,"administratorGroup":"fusionapps_gg_prod_admin"
                         }
         ,"identityDomain":"OGGDomain1"
         }' 
         https://localhost:9010/services/v2/deployments/ServiceManager/authorization/profiles/smProfile