Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Create an OAuth Client: XML and JSON Examples 


XML

JSON

Example Request
Expand
titleXML


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<oauthClient retainSysIds="true">
    <authorizationEndpoint>https://accounts.google.com/o/oauth2/v2/auth</authorizationEndpoint>
    <clientId>client_id</clientId>
    <clientSecret>client_secret</clientSecret>
    <clusterRedirectUrls>
        <clusterRedirectUrl>
            <clusterNode>node1:8080-uc</clusterNode>
            <redirectUrl>http://localhost:8080/uc/oauth2/callback</redirectUrl>
        </clusterRedirectUrl>
    </clusterRedirectUrls>
    <description>description</description>
    <name>Google</name>
    <opswiseGroups/>
    <provider>Google</provider>
    <scopes>
        <scope>https://mail.google.com</scope>
    </scopes>
    <sysId>239119555c2c427f8f5b29faeecfdc27</sysId>
    <tokenEndpoint>https://oauth2.googleapis.com/token</tokenEndpoint>
</oauthClient>
Expand
titleJSON


{
    "authorizationEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
    "clientId": "client_id",
    "clientSecret": "client_secret","
    "clusterRedirectUrls": [
        {
            "clusterNode": "node1:8080-uc",
            "redirectUrl": "htttp://localhost:8080/uc/oauth2/callback"
        }
    ],
    "description": "description",
    "name": "Google OAuth Client",
    "opswiseGroups": [],
    "provider": "Google",
    "retainSysIds": true,
    "scopes": [
        "https://mail.google.com"
    ],
    "sysId": "239119555c2c427f8f5b29faeecfdc27",
    "tokenEndpoint": "https://oauth2.googleapis.com/token",
}

Modify an OAuth Client 


 Description

URI

http://host_name/uc/resources/oauthclient

HTTP Method

PUT

Description

Modifies an OAuth Client.

Example URI

http://localhost:8080/uc/resources/oauthclient

Authentication

HTTP Basic

Produces Content-Type

n/a

Consumes Content-Type

application/xml, application/json

Example Responses

  • Status 200

    • Successfully updated the OAuth Client with id {uuid}.

  • Status 400

    • Error message.

  • Status 403

    • Operation prohibited due to security constraints.

  • Status 404

    • An OAuth Client with name “{name}” does not exist.

    • An OAuth Client with id "{uuid}" does not exist.

  • Status 500

    • Unexpected request failure. See log(s) for more details.

...

Read an OAuth Client: XML and JSON Examples 


XML

JSON

Example Response
Expand
titleXML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<oauthClient exportReleaseLevel="7.3.0.0" exportTable="ops_oauth_client" retainSysIds="true" version="5">
    <authorizationEndpoint>https://accounts.google.com/o/oauth2/v2/auth</authorizationEndpoint>
    <clientId>client_id</clientId>
    <clusterRedirectUrls>
        <clusterRedirectUrl>
            <clusterNode>asus-pc:8080-uc</clusterNode>
            <redirectUrl>http://localhost:8180/uc/oauth2/callback</redirectUrl>
        </clusterRedirectUrl>
    </clusterRedirectUrls>
    <description>description</description>
    <name>Google</name>
    <opswiseGroups/>
    <provider>Google</provider>
    <scopes>
        <scope>https://mail.google.com</scope>
    </scopes>
    <sysId>239119555c2c427f8f5b29faeecfdc27</sysId>
    <tokenEndpoint>https://oauth2.googleapis.com/token</tokenEndpoint>
</oauthClient>
Expand
titleJSON
{
    "authorizationEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
    "clientId": "client_id",
    "clusterRedirectUrls": [
        {
            "clusterNode": "node1:8080-uc",
            "redirectUrl": "http://localhost:8080/uc/oauth2/callback"
        }
    ],
    "description": "description",
    "exportReleaseLevel": "7.3.0.0",
    "exportTable": "ops_oauth_client",
    "name": "Google",
    "opswiseGroups": [],
    "provider": "Google",
    "retainSysIds": true,
    "scopes": [
        "https://mail.google.com"
    ],
    "sysId": "239119555c2c427f8f5b29faeecfdc27",
    "tokenEndpoint": "https://oauth2.googleapis.com/token",
    "version": 5
}

Delete an OAuth Client


 Description

URI

http://host_name/uc/resources/oauthclient

HTTP Method

DELETE

Description

Deletes an OAuth Client.

Example URI

http://localhost:8080/uc/resources/oauthclient?oauthclientname=testOauthClient

Authentication

HTTP Basic

Produces Content-Type

n/a

Consumes Content-Type

n/a

Example Responses

  • Status 200

    • OAuth Client deleted successfully.

  • Status 404

    • An OAuth Client with name “{name}” does not exist.

    • An OAuth Client with id "{uuid}" does not exist.

...

List an OAuth Client: XML and JSON Examples 


XML

JSON

Example Response
Expand
titleXML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<oauthClients>
    <oauthClient exportReleaseLevel="7.3.0.0" exportTable="ops_oauth_client" version="5">
        <authorizationEndpoint>https://accounts.google.com/o/oauth2/v2/auth</authorizationEndpoint>
        <clientId>client_id</clientId>
        <clusterRedirectUrls>
            <clusterRedirectUrl>
                <clusterNode>node1:8080-uc</clusterNode>
                <redirectUrl>http://localhost:8080/uc/oauth2/callback</redirectUrl>
            </clusterRedirectUrl>
        </clusterRedirectUrls>
        <description>description</description>
        <name>Google</name>
        <opswiseGroups/>
        <provider>Google</provider>
        <scopes>
            <scope>https://mail.google.com</scope>
        </scopes>
        <sysId>239119555c2c427f8f5b29faeecfdc27</sysId>
        <tokenEndpoint>https://oauth2.googleapis.com/token</tokenEndpoint>
    </oauthClient>
</oauthClients>
Expand
titleJSON
[
    {
        "authorizationEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
        "clientId": "client_id",
        "clusterRedirectUrls": [
            {
                "clusterNode": "node1:8080-uc",
                "redirectUrl": "http://localhost:8080/uc/oauth2/callback"
            }
        ],
        "description": "description",
        "exportReleaseLevel": "7.3.0.0",
        "exportTable": "ops_oauth_client",
        "name": "Google",
        "opswiseGroups": [],
        "provider": "Google",
        "scopes": [
            "https://mail.google.com"
        ],
        "sysId": "239119555c2c427f8f5b29faeecfdc27",
        "tokenEndpoint": "https://oauth2.googleapis.com/token",
        "version": 5
    },
]