Skip to content

Latest commit

 

History

History
171 lines (131 loc) · 5.58 KB

AuthorizationServerKeysApi.md

File metadata and controls

171 lines (131 loc) · 5.58 KB

Okta.Sdk.Api.AuthorizationServerKeysApi

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
ListAuthorizationServerKeys GET /api/v1/authorizationServers/{authServerId}/credentials/keys List all Credential Keys
RotateAuthorizationServerKeys POST /api/v1/authorizationServers/{authServerId}/credentials/lifecycle/keyRotate Rotate all Credential Keys

ListAuthorizationServerKeys

List<AuthorizationServerJsonWebKey> ListAuthorizationServerKeys (string authServerId)

List all Credential Keys

Lists all credential keys

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListAuthorizationServerKeysExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AuthorizationServerKeysApi(config);
            var authServerId = GeGRTEr7f3yu2n7grw22;  // string | `id` of the Authorization Server

            try
            {
                // List all Credential Keys
                List<AuthorizationServerJsonWebKey> result = apiInstance.ListAuthorizationServerKeys(authServerId).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthorizationServerKeysApi.ListAuthorizationServerKeys: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
authServerId string `id` of the Authorization Server

Return type

List<AuthorizationServerJsonWebKey>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

RotateAuthorizationServerKeys

List<AuthorizationServerJsonWebKey> RotateAuthorizationServerKeys (string authServerId, JwkUse use)

Rotate all Credential Keys

Rotates all credential keys

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class RotateAuthorizationServerKeysExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new AuthorizationServerKeysApi(config);
            var authServerId = GeGRTEr7f3yu2n7grw22;  // string | `id` of the Authorization Server
            var use = new JwkUse(); // JwkUse | 

            try
            {
                // Rotate all Credential Keys
                List<AuthorizationServerJsonWebKey> result = apiInstance.RotateAuthorizationServerKeys(authServerId, use).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthorizationServerKeysApi.RotateAuthorizationServerKeys: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
authServerId string `id` of the Authorization Server
use JwkUse

Return type

List<AuthorizationServerJsonWebKey>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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