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"
        }]
        }'

创建应用程序

以下示例显示了如何使用 OAM 创建具有某些重定向 URI 的应用程序:

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