Management API - SSO
- 1 Introduction
- 2 Access to API
- 2.1 Scope of the API
- 3 URI format
- 4 Data types, attributes and linking
- 5 HTTP methods
- 6 Terminators
- 6.1 $link
- 6.2 $attribute
- 7 HTTP response status codes
- 8 Response messages
- 8.1 Example
- 9 HTTP methods
- 10 Create/Update objects
- 10.1 Site
- 10.2 Application
- 10.3 Group
- 10.4 Policy
- 10.5 PolicyItem
- 10.6 User
- 10.7 Mappings
- 10.8 Refresh token policy
- 11 Querying objects
- 12 Linking objects
- 12.1 Link types, linking and removing links
- 12.1.1 Site
- 12.1.2 Application
- 12.1.3 Group
- 12.1.4 Method
- 12.1.5 Server
- 12.1.6 Policy
- 12.1.7 Policyitem
- 12.1.8 Credential
- 12.1.9 Examples
- 12.1 Link types, linking and removing links
- 13 Deleting objects
- 14 Object request
- 15 Using Management API to manage keys
- 15.1 Create a new key or update an existing key
- 15.1.1 Path parameters
- 15.1.2 Query parameters
- 15.1.3 Responses
- 15.2 Retrieve a key
- 15.2.1 Path parameters
- 15.2.2 Responses
- 15.3 Delete a key
- 15.3.1 Path parameters
- 15.3.2 Responses
- 15.4 Create a new system-wide key association
- 15.4.1 Path parameters
- 15.4.2 Responses
- 15.5 Retrieve a key association
- 15.5.1 Path parameters
- 15.5.2 Responses
- 15.6 Remove an existing system-wide key association
- 15.6.1 Path parameters
- 15.6.2 Responses
- 15.7 Get certificate signing request
- 15.7.1 Path parameters
- 15.7.2 Responses
- 15.8 Store signed certificate
- 15.8.1 Path parameters
- 15.8.2 Request body
- 15.8.3 Responses
- 15.1 Create a new key or update an existing key
- 16 Example - SAML2 or OAuth2 integration
- 17 Example - Office365 Integration
Introduction
SSO Management API is a REST API for managing SSO Server. With Management API it is possible to automate management tasks that previously were only possible with the web browser based Management Console.
Access to API
To operate REST API an OAuth2 access token is needed. To get the access token an OAuth2 Resource Server configured as Ubisecure agent needs to be activated and configured in the Ubisecure SSO server.
SSO Management REST API calls need to have the access token in the bearer authorization header.
Authorization: Bearer {YOUR_SECURE_TOKEN}
Please check OAuth 2.0 API - SSO page for more information about OAuth API.
Please check SSO Management API Configuration Guide for information how to configure and start using SSO API.
Scope of the API
Ubisecure SSO REST API can be used to create:
Sites
Applications
Update application metadata
Groups
Authentication Policies
PolicyItem
Links between objects
Users
Mappings
Keys - see Management API - SSO#Using Management API to manage keys for API calls and SSO key rotation for further details
URI format
The URI format of Ubisecure SSO Management API is based on the following principles:
Path starts with object type
Example: /site
After object type, the path to the object
Example: /site/acmecorporation/
Example: /group/acmecorporation/users
Example: /application/acmecorporation/salesforce
Example: /policy/acmecorporation/policy
URI can contain a terminator ($link, $attribute) after the path to an object. This is described in more detail below in section Terminators.
Data types, attributes and linking
To get more information on how the attributes and linkings are connected, there are three sub-pages explaining them in more detail.
You can also see a overview of the schema in our example site https://manage.example.ubidemo.com/sso-api-sample/schema/models
HTTP methods
GET is used to query data.
POST writes a new object.
PUT writes object (update existing object)
DELETE is used to delete object or remove object linking.
Terminators
$link
Is used as part of the URI to link objects to other objects, and to list/query objects linked to other objects.
After $link the URI contains the path to another object as setter for the scope for the listing of related objects.
Section Response Messages describes in detail how links are used.
$attribute
Is used to query or update object attribute values. Version Ubisecure SSO 7.5.0 contains $attribute setting for application metadata – other $attribute settings will be available in future versions.
HTTP response status codes
Ubisecure SSO Management REST API uses following HTTP response status codes:
HTTP Response Status 200 (GET, DELETE)
Operation was successful. Returned when no error in GET, and after DELETE.
HTTP Response Status 201 (Create, Update) (POST, PUT)
Resource created or updated successfully.
HTTP Response Status 400 (Bad Request)
The request was invalid.
HTTP Response Status 401 (Not Authorized)
Invalid credentials
Response messages
Client can choose the result to be plain text, JSON or XML.This is set on the HTTP accept – header by setting the media type to Accept: text/plain; or Accept: application/json; or Accept: application/xml.
Example
POST /site/AcmeCorporation
type=site name=Sitetest
Response:
Plain text:
site /site/SiteTestJSON:
{"type":"site","id":"/site/SiteTest","attributes":{"name":"SiteTest"}}XML:
<object type="site" id="/site/SiteTest"><attribute name="name" value="SiteTest"/></object>
HTTP methods
GET
For successful GET operations the API returns HTTP status code 200. Response content contains object type, id (path) and attributes.
Format of query to Ubisecure SSO REST API is as described in the section URI Format. Section Response Messages describes in more detail the querying of object links.
Example GET-query and response
GET /site/System
Response JSON: