Skip to content

Latest commit

 

History

History
267 lines (193 loc) · 7.76 KB

SsoApi.md

File metadata and controls

267 lines (193 loc) · 7.76 KB

com.ultracart.admin.v2.Api.SsoApi

All URIs are relative to https://secure.ultracart.com/rest/v2

Method HTTP request Description
GetSsoSessionUser GET /sso/session/user Get single sign on session user
SsoAuthorize PUT /sso/authorize Authorize a single sign on session
SsoSessionRevoke DELETE /sso/session/revoke Revoke single sign on session
SsoToken PUT /sso/token Exchange a single sign on code for a simple key token

GetSsoSessionUser

User GetSsoSessionUser ()

Get single sign on session user

This is the equivalent of logging out of the single sign on session

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class GetSsoSessionUserExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new SsoApi(simpleKey);


            try
            {
                // Get single sign on session user
                User result = apiInstance.GetSsoSessionUser();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SsoApi.GetSsoSessionUser: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

User

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SsoAuthorize

SingleSignOnAuthorizeResponse SsoAuthorize (SingleSignOnAuthorizeRequest authorizationRequest)

Authorize a single sign on session

Starts the process of authorizing a single sign on session.

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class SsoAuthorizeExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new SsoApi(simpleKey);

            var authorizationRequest = new SingleSignOnAuthorizeRequest(); // SingleSignOnAuthorizeRequest | Authorization request

            try
            {
                // Authorize a single sign on session
                SingleSignOnAuthorizeResponse result = apiInstance.SsoAuthorize(authorizationRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SsoApi.SsoAuthorize: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
authorizationRequest SingleSignOnAuthorizeRequest Authorization request

Return type

SingleSignOnAuthorizeResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SsoSessionRevoke

void SsoSessionRevoke ()

Revoke single sign on session

This is the equivalent of logging out of the single sign on session

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class SsoSessionRevokeExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new SsoApi(simpleKey);


            try
            {
                // Revoke single sign on session
                apiInstance.SsoSessionRevoke();
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SsoApi.SsoSessionRevoke: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SsoToken

SingleSignOnTokenResponse SsoToken (SingleSignOnTokenRequest tokenRequest)

Exchange a single sign on code for a simple key token

Called by your application after receiving the code back on the redirect URI to obtain a simple key token to make API calls with

Example

using System;
using System.Diagnostics;
using com.ultracart.admin.v2.Api;
using com.ultracart.admin.v2.Client;
using com.ultracart.admin.v2.Model;

namespace Example
{
    public class SsoTokenExample
    {
        public void main()
        {

            // Create a Simple Key: https://ultracart.atlassian.net/wiki/spaces/ucdoc/pages/38688545/API+Simple+Key
            const string simpleKey = "109ee846ee69f50177018ab12f008a00748a25aa28dbdc0177018ab12f008a00";
            var api = new SsoApi(simpleKey);

            var tokenRequest = new SingleSignOnTokenRequest(); // SingleSignOnTokenRequest | Token request

            try
            {
                // Exchange a single sign on code for a simple key token
                SingleSignOnTokenResponse result = apiInstance.SsoToken(tokenRequest);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling SsoApi.SsoToken: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
tokenRequest SingleSignOnTokenRequest Token request

Return type

SingleSignOnTokenResponse

Authorization

ultraCartOauth, ultraCartSimpleApiKey

HTTP request headers

  • Content-Type: application/json; charset=UTF-8
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]