Skip to content

Single Sign On Configuration

Permissions

PermissionManageable via RolesDescription
listtrueAllow list SSO configurations
viewtrueAllow view single SSO configuration details
createtrueAllow create SSO configurations
edittrueAllow edit SSO configurations
deletetrueAllow delete SSO configurations

Permissions for SSO Config can be checked by:

ContextEndpointLocationAvailable perms
Global scopeGET /api/users/permissions/single_sign_onlist, view, edit, create, delete
Specific single_sign_onGET /api/single-sign-on/{id}/_meta.permissionslist, view, edit, create, delete

References

POST /api/single-sign-on/

Creates Single Sign On Configuration.

Permissions

Requires authentication and single_sign_on.create permission.

Request

  • Body parameters
KeyTypeNotes
namestringDisplayed name
client_idstringClient ID
tenant_idstringProvider specific:
  • Azure: Azure tenant identifier
  • Okta: Okta tenant (organization) domain (for example, acme.okta.com)
providerenumProvider (one of azure, okta)
is_enabledboolEnabled flag
auto_create_userboolIf should create user when it does not exists
rolesenumAttached roles ID's after create user
*is_word_addin_enabledboolIf configuration supports Word Addin (optional)
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
POST /api/single-sign-on/ 

{
  "name": <string>,
  "client_id":  <string>,  
  "client_secret":  <string>, 
  "tenant_id":  <string>,  
  "provider":  <string>,  
  "is_enabled": <bool>,  
  "auto_create_user":  <bool>, 
  "roles":  <enum>,  
  "is_word_addin_enabled": <bool>
}

Validations

  • Max 25 objects
  • name
    • Max length: 100
    • Case insensitive unique
  • client_id
    • Max length: 255
    • [a-zA-Z0-9-]
  • client_secret
    • Max length: 255
    • [a-zA-Z0-9-]
  • tenant_id
    • Max length: 255
    • [a-zA-Z0-9-]
  • providers
    • one of (azure, okta)
  • is_word_addin_enabled
    • only with provider = azure
    • only one per each azure application SSO, with set as True. Only one Azure application SSO with the same client_id and tenant_id can have is_word_addin_enabled set as True.

Response

KeyTypeNotes
ididAutomatically generated by the backend.
namestringDisplayed name
client_idstringClient ID
tenant_idstringProvider specific:
  • Azure: Azure tenant identifier
  • Okta: Okta tenant (organization) domain (for example, acme.okta.com)
providerenumProvider (one of azure, okta)
is_enabledboolEnabled flag
auto_create_userboolIf should create user when it does not exists
is_word_addin_enabledenumIf configuration supports Word Addin
rolesenumAttached roles ID's after create user
redirect_uriurlLogin callback URL
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
logout_urlurlLogout callback URL
_meta.labelsObjectObject containing labels for attributes.
_meta.permissionsObjectObject describing permissions.
  • Successful status 201 Created
  • Response body schema
json
{  
   "id": <int>,  
   "name": <string>, 
   "client_id": <string>, 
   "tenant_id": <string>, 
   "is_enabled": <bool>,  
   "is_word_addin_enabled": <bool>,  
   "auto_create_user": <bool>,  
   "roles": <enum>,  
   "provider": <string>,  
   "redirect_uri": <url>, 
   "created_at": <datetime>,  
   "created_by": <user>, 
   "modified_at": <datetime>,  
   "modified_by": <user>,
   "logout_url": <url>, 
  "_meta": { 
      "labels": { 
          "roles": <enum> 
      }, 
      "permissions": <set> 
  } 
}

Errors

CauseResponse codeMessage
Using is_word_addin_enabled param when provider is not azure400 Bad Request"is_word_addin_enabled": "Provider must be "azure"."
Max 25 SSO Config exceeded400 Bad Request"detail": ["Limit of 25 SSO configurations has been exceeded."]

GET /api/single-sign-on/

Returns list of Single Sign On Configurations.

Permissions

Requires authentication and single_sign_on.list permission.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/single-sign-on/

Response

KeyTypeNotes
limitint
offsetint
total_countintTotal number of results visible to the user (based on permissions).
filtered_countintNumber of results visible to the user (based on permissions) with filters applied.
nexturlNext page URL (null if there is no next page)
previousurlPrevious page URL (null if there is no previous page)
resultsArrayList of results. Described in the next table.

Response results array

KeyTypeNotes
ididAutomatically generated by the backend.
namestringDisplayed name
client_idstringClient ID
tenant_idstringProvider specific:
  • Azure: Azure tenant identifier
  • Okta: Okta tenant (organization) domain (for example, acme.okta.com)
providerenumProvider (one of azure)
is_enabledboolEnabled flag
auto_create_userboolIf should create user when it does not exists
is_word_addin_enabledenumIf configuration supports Word Addin
rolesenumAttached roles ID's after create user
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
_meta.labelsObjectObject containing labels for attributes.
_meta.permissionsObjectObject describing permissions.
  • Successful status 200 OK
  • Response body schema
json
{
   "limit": <int>,  
   "offset": <int>,  
   "filtered_count": <int>,  
   "total_count": <int>,  
   "next": <url>,  
   "previous": <url>,  
   "results": [
     {
       "id": <int>,
       "name": <string>,
       "client_id": <string>,
       "tenant_id": <string>,
       "is_enabled": <bool>,
       "is_word_addin_enabled": <string>,
       "auto_create_user": <bool>,
       "roles": <enum>,
       "provider": <string>,
       "redirect_uri": <url>,
       "created_at": <datetime>,
       "created_by": <user>,
       "modified_at": <datetime>,
       "modified_by": <user>,
       "_meta": {
         "labels": {
           "roles": <enum>
         },
         "permissions": <set>
       }
     }
   ]
}

Sorting

ParameterExampleNotes
id/{%endpoint%}/?ordering=idAscending
id/{%endpoint%}/?ordering=-idDescending (-)
name/{%endpoint%}/?ordering=nameAscending
name/{%endpoint%}/?ordering=-nameDescending (-)
created_at/{%endpoint%}/?ordering=created_atAscending
created_at/{%endpoint%}/?ordering=-created_atDescending (-)
modified_at/{%endpoint%}/?ordering=modified_atAscending
modified_at/{%endpoint%}/?ordering=-modified_atDescending (-)

Filtering

Please check ALX API standards for predicates available per type.

ParameterType
idint
namestring
providerenum
is_enabledbool
auto_create_userbool
is_word_addin_enabledbool
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser

Errors

ErrorResponse codeMessage
Wrong ordering value400 Bad Request"ordering": ["Select a valid choice. {value} is not one of the available choices."]

GET /api/single-sign-on/ id/

Returns single SSO Config by id.

Permissions

Requires authentication and single_sign_on.view permission.

Request

  • URL parameters
KeyTypeNotes
idint
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
GET /api/single-sign-on/ `id`/

Response

KeyTypeNotes
ididAutomatically generated by the backend.
namestringDisplayed name
client_idstringClient ID
tenant_idstringProvider specific:
  • Azure: Azure tenant identifier
  • Okta: Okta tenant (organization) domain (for example, acme.okta.com)
providerenumProvider (one of azure)
is_enabledboolEnabled flag
auto_create_userboolIf should create user when it does not exists
is_word_addin_enabledenumIf configuration supports Word Addin
rolesenumAttached roles ID's after create user
redirect_uriurlLogin callback URL
created_atdatetime
created_byuser
modified_atdatetime
logout_urlurlLogout callback URL
_meta.labelsObjectObject containing labels for attributes.
_meta.permissionsObjectObject describing permissions.
  • Successful status 200 OK
  • Response body schema:
json
{
  "id": <int>,  
   "name": <string>, 
   "client_id": <string>, 
   "tenant_id": <string>, 
   "is_enabled": <bool>,  
   "is_word_addin_enabled": <bool>,  
   "auto_create_user": <bool>,  
   "roles": <enum>,  
   "provider": <string>,  
   "redirect_uri": <url>, 
   "created_at": <datetime>,  
   "created_by": <user>, 
   "modified_at": <datetime>,  
   "modified_by": <user>, 
   "logout_url": <url>, 
  "_meta": { 
      "labels": { 
          "roles": <enum> 
      }, 
      "permissions": <set> 
  } 
}

Errors

ErrorResponse codeMessage
Insufficient permissions403 Forbidden"detail": "You do not have permission to perform this action."
SSO Config with "id" does not exist404 Not Found"detail": "Not found."

PATCH /api/single-sign-on/ id/

Updates single SSO Config.

Permissions

Requires authentication and single_sign_on.edit permission.

Request

  • URL parameters
KeyTypeNotes
idint
  • Body parameters
KeyTypeNotes
namestringDisplayed name
client_idstringClient ID
tenant_idstringProvider specific:
  • Azure: Azure tenant identifier
  • Okta: Okta tenant (organization) domain (for example, acme.okta.com)
is_enabledboolEnabled flag
auto_create_userboolIf should create user when it does not exists
rolesenumAttached roles ID's after create user
is_word_addin_enabledenumIf configuration supports Word Addin
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
PATCH /api/single-sign-on/ `id`/

{
  "name": <string>,
  "client_id":  <string>,  
  "client_secret":  <string>, 
  "tenant_id":  <string>,  
  "is_enabled": <bool>,  
  "auto_create_user":  <bool>, 
  "roles":  <enum>,  
  "is_word_addin_enabled": <bool>
  ...
}

Response

KeyTypeNotes
ididAutomatically generated by the backend.
namestringDisplayed name
client_idstringClient ID
tenant_idstringProvider specific:
  • Azure: Azure tenant identifier
  • Okta: Okta tenant (organization) domain (for example, acme.okta.com)
providerenumProvider (one of azure)
is_enabledboolEnabled flag
auto_create_userboolIf should create user when it does not exists
is_word_addin_enabledenumIf configuration supports Word Addin
rolesenumAttached roles ID's after create user
redirect_uriurlLogin callback URL
created_atdatetime
created_byuser
modified_atdatetime
modified_byuser
logout_urlurlLogout callback URL
_meta.labelsObjectObject containing labels for attributes.
_meta.permissionsObjectObject describing permissions.
  • Successful status 200 OK
  • Response body schema:
json
{
   "id": <int>,  
   "name": <string>, 
   "client_id": <string>, 
   "tenant_id": <string>, 
   "is_enabled": <bool>,  
   "is_word_addin_enabled": <bool>,  
   "auto_create_user": <bool>,  
   "roles": <enum>,  
   "provider": <string>,  
   "redirect_uri": <url>, 
   "created_at": <datetime>,  
   "created_by": <user>, 
   "modified_at": <datetime>,  
   "modified_by": <user>, 
   "logout_url": <url>, 
  "_meta": { 
      "labels": { 
          "roles": <enum> 
      }, 
      "permissions": <set> 
  } 
}

Errors

CauseResponse codeMessage
Using is_word_addin_enabled param when provider is not azure400 Bad Request"is_word_addin_enabled": "Provider must be "azure"."

DELETE /api/single-sign-on/id/

Deletes single SSO Config.

Permissions

Requires authentication and single_sign_on.delete permission.

Request

  • URL parameters
KeyTypeNotes
idint
  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
DELETE /api/single-sign-on/`id`/

Response

  • Successful status 204 No Content

OPTIONS /api/single-sign-on/

Permissions

Requires authentication only.

Request

  • Headers
Content-Type: application/json
Authorization: JWT access_token
  • Schema
json
OPTIONS /api/single-sign-on/

Response

  • Successful status 200 OK
  • Response body:
json
{
  "list": {  
        "columns": [  
            {  
                "alias": "id",  
                "type": "int",  
                "predicates": [  
                    "exact",  
                    "gt",  
                    "gte",  
                    "lt",  
                    "lte",  
                    "range"  
                ],  
                "sort_ok": false  
            },  
            {  
                "alias": "name",  
                "type": "string",  
                "predicates": [  
                    "exact",  
                    "iexact",  
                    "contains",  
                    "icontains",  
                    "startswith",  
                    "istartswith",  
                    "endswith",  
                    "iendswith"  
                ],  
                "sort_ok": true  
            },  
            {  
                "alias": "provider",  
                "type": "enum",  
                  "predicates": [  
                    "exact",  
                    "in"  
                ],  
                "sort_ok": false,  
                "values": [  
                    {  
                        "value": "azure",  
                        "text": "Microsoft Azure"  
                    },
                    {
                        "value": "okta",
                        "text": "Okta" 
                    }
                ] 
            },  
            {  
                "alias": "is_enabled",  
                "type": "boolean",  
                "predicates": ["exact"],  
                "sort_ok": false  
            },
            {  
                "alias": "is_word_addin_enabled",  
                "type": "boolean",  
                "predicates": ["exact"],  
                "sort_ok": false  
            },
            {  
                "alias": "auto_create_user",  
                "type": "boolean",  
                "predicates": ["exact"],  
     
                "sort_ok": false  
            },  
            {  
                "alias": "created_at",  
                "type": "datetime",  
                "predicates": [  
                    "exact",  
                    "gt",  
                    "gte",  
                    "lt",  
                    "lte",  
                    "range"  
                ],  
                "sort_ok": true  
            },  
            {  
                "alias": "created_by",  
                "type": "enum",  
                "predicates": [  
                    "exact",  
                    "in"  
                ],  
                "sort_ok": false,  
                "autocomplete": "/api/users/autocomplete/?text__icontains="  
            },  
            {  
                "alias": "modified_at",  
                "type": "datetime",  
                "predicates": [  
                    "exact",  
                    "gt",  
                    "gte",  
                    "lt",  
                    "lte",  
                    "range"  
                ],  
                "sort_ok": true  
            },  
            {  
                "alias": "modified_by",  
                "type": "enum",  
                "predicates": [  
                    "exact",  
                    "in"  
                ],  
                "sort_ok": false,  
                "autocomplete": "/api/users/autocomplete/?text__icontains="  
            }  
        ]  
    },  
    "details": {  
        "schema": [  
            {  
                "alias": "name",  
                "type": "string",  
                "required": true,  
                "validators": [  
                    {  
                        "type": "max_length",  
                        "length": 100  
                    }  
                ]  
            },  
            {  
                "alias": "provider",  
                "type": "enum",  
                "required": true,  
                "values": [  
                    {  
                        "value": "azure",  
                        "text": "Microsoft Azure"  
                    },
                    {
                      "value": "okta",
                      "text": "Okta" 
                    }
                ]  
            }, 
            {  
                "alias": "client_id",  
                "type": "string",  
                "required": true,  
                "validators": [  
                    {  
                        "type": "max_length",  
                        "length": 256  
                    }  
                ]  
            },  
            {  
                "alias": "client_secret",  
                "type": "string",  
                "required": true,  
                "validators": [  
                    {  
                        "type": "max_length",  
                        "length": 256  
                    }  
                ]  
            },  
            {  
                "alias": "tenant_id",  
                "type": "string",  
                "required": true,  
                "validators": [  
                    {  
                        "type": "max_length",  
                        "length": 256  
                    }  
                ]  
            },  
            {  
                "alias": "is_enabled",  
                "type": "bool",  
                "required": false  
            },
            {
                "alias": "is_word_addin_enabled",  
                "type": "bool",  
                "required": false  
            },
            {  
                "alias": "auto_create_user",  
                "type": "bool",  
                "required": false  
            },  
            {  
                "alias": "roles",  
                "type": "set",  
                "required": false,  
                "autocomplete": "/api/roles/autocomp?text__icontains=",  
                "validators": [  
                    {  
                        "type": "max_items",  
                        "items": 10  
                    }  
                ] 
            }  
        ]  
    },  
    "restrictions": {  
        "limit_items": 25  
    }
}

POST /api/single-sign-on/login/

Retrieve provider authorization url.

Permissions

Public access endpoint.

Request

  • Body parameters
KeyTypeNotes
idint
  • Headers
Content-Type: application/json
  • Schema

POST /api/single-sign-on/login/

json
{
  "id": <int>,
}

Response

KeyTypeNotes
redirect_uriurl
  • Successful status 200 OK
  • Response body:
json
{ 
    "redirect_uri": "https://example-tenant.okta.com/oauth2/default/v1/authorize?client_id=YOUR_CLIENT_ID&response_type=code&scope=openid+profile+email&response_mode=query&token_endpoint_auth_method=client_secret_post&redirect_uri=https%3A%2F%2Fyour-app-domain.com%2Fsingle-sign-on%2Fcallback%2F1%2F&state=EXAMPLE_STATE_TOKEN"
}

Errors

CauseResponse codeMessage
No id in request400 Bad Request"detail": {"id":["This field is required."]}
No request body400 Bad Request"detail": {"id":["This field is required."]}
Wrong type of data400 Bad Request"detail": Invalid data. Expected a dictionary, but got str.
Invalid id in URL404 Not Found"detail": ["Not found."]

POST /api/single-sign-on/callback/id/

Retrieve the access and refresh tokens.

Permissions

Public access endpoint is secured only with an SSO state parameter (CSRF protection only).

Request

  • Body parameters
KeyTypeNotes
idint
codestringA temporary authorization code received from Okta that will be exchanged for an access token. Valid for a short time period and can only be used once when exchange it for tokens.
statestringAn arbitrary alphanumeric string that the authorization server reproduces when redirecting the user agent back to the client. authorization parameters. This is used to help prevent cross-site request forgery. (optional)
session_statestringSession State. JSON [RFC7159] string that represents the End-User's login state at the OP. This value is opaque to the RP. authorization parameters. This is REQUIRED if session management is supported. (optional)
  • Headers
Content-Type: application/json
  • Schema

POST /api/single-sign-on/callback/id/

json
{
  "code": <string>,
  "state": <string>,  
  "session_state": <string>,
}

Response

KeyTypeNotes
refreshstring
accessstring
  • Successful status 200 OK
  • Response body:
json
{ 
    "refresh": "REFRESH_TOKEN", 
    "access": "ACCESS_TOKEN"
}

Errors

CauseResponse codeMessage
no code in request400 Bad Request"detail": {"code": ["This field is required."]}
One of parameters is blank400 Bad Request"detail": { "field": ["This field may not be blank."]}
One of parameters is null400 Bad Request"detail": { "field": ["This field may not be null."]}
Insufficient data, invalid code etc.403 Forbidden"detail": "You do not have permission to perform this action."
Login not allowed for account type restricted to password login only403 Forbidden"detail": "This user account is not allowed to log in using Single Sign-On."
Invalid id in URL404 Not Found"detail": ["Not found."]