Add a new Resource Server
post
/oam/services/rest/ssa/api/v1/oauthpolicyadmin/application
Request
Supported Media Types
- application/json
- application/xml
Resource Server that needs to be created
Root Schema : ResourceServer
Type:
Show Source
object
-
description:
string
-
idDomain:
string
Name of the Identity Domain under which the resource server is created
-
name:
string
Name of the Resource Server
-
scopes:
array scopes
-
tokenAttributes:
array tokenAttributes
Nested Schema : tokenAttributes
Type:
Show Source
array
-
[0]:
object AttributeSettings
Custom attributes that can be added to the Access Token
Nested Schema : AttributeSettings
Type:
object
Custom attributes that can be added to the Access Token
Show Source
-
attrName:
string
Name of the custom attribute
-
attrType:
string
Allowed Values:
[ "STATIC", "DYNAMIC" ]
Type of the Attribute -
attrValue:
string
Value of the custom attribute. This could be a static value or a dynamic one that is evaluated and substituted.
Response
Supported Media Types
- application/json
200 Response
Sucessfully created entity - OAuthResourceServer, detail
Root Schema : ResourceServer
Type:
Show Source
object
-
description:
string
-
idDomain:
string
Name of the Identity Domain under which the resource server is created
-
name:
string
Name of the Resource Server
-
scopes:
array scopes
-
tokenAttributes:
array tokenAttributes
Nested Schema : tokenAttributes
Type:
Show Source
array
-
[0]:
object AttributeSettings
Custom attributes that can be added to the Access Token
Nested Schema : AttributeSettings
Type:
object
Custom attributes that can be added to the Access Token
Show Source
-
attrName:
string
Name of the custom attribute
-
attrType:
string
Allowed Values:
[ "STATIC", "DYNAMIC" ]
Type of the Attribute -
attrValue:
string
Value of the custom attribute. This could be a static value or a dynamic one that is evaluated and substituted.
422 Response
Failed to create OAuth entity "ResourceServer" - name "NameofResourceServer"
Examples
This example demonstrates a sample request against the server for creating a new Resource Server.
cURL Example
curl -i -H 'Content-Type: application/json' -H 'Authorization:Basic d2VibG9naWM6V2VsY29tZTE=' --request POST http:<AdminServerHost:Port>/oam/services/rest/ssa/api/v1/oauthpolicyadmin/application -d {"name":"ResServer1","description":"TestResourceServer","scopes":[{"scopeName":"scope1","description":"ViewPage"},{"scopeName":"scope2","description":"UpdatePage"},{"scopeName":"scope3","description":"ModifyPage"}],"tokenAttributes":[{"attrName":"sessionId","attrValue":"$session.id","attrType":"DYNAMIC"},{"attrName":"resSrvAttr","attrValue":"RESOURCECONST","attrType":"STATIC"}],"idDomain":"TestDomain1","audienceClaim":{"subjects":["ab0"]}}
Example of Request Body
The following example shows the contents of the response body for creating a new Resource Server in JSON format.
HTTP/1.1 200 OK Date: Thu, 27 Jul 2017 17:30:16 GMT Content-Length: 27 Content-Type: text/plain X-ORACLE-DMS-ECID: 78d30c19-07b6-4ac2-a39b-f1cbd8182ebb-0000012d X-ORACLE-DMS-RID: 0 Set-Cookie: JSESSIONID=4J2FGVVUN8MXI5vdemvJw3HFPHyraFXIDVRoRUZwc_7Uia_SOhG5!-1875566563; path=/; HttpOnly Sucessfully created entity - OAuthResourceServer, detail...