Custom authorization server


#1

Unable to create, update and delete okta authorization server with below URL and error.
error: json body was not well formed

URL : /api/v1/authorizationServers

{
  "id": "ausain6z9zIedDCxB0h7",
  "name": "Sample Authorization Server",
  "description": "Authorization Server Description",
  "audiences": "https://api.resource.com",
  "issuer": "https://dev-341069.oktapreview.com/oauth2/ausain6z9zIedDCxB0h7",
  "issuerMode": "ORG_URL",
  "status": "ACTIVE",
  "created": "2017-05-17T22:25:57.000Z",
  "lastUpdated": "2017-05-17T22:25:57.000Z",
  "credentials": {
    "signing": {
      "rotationMode": "AUTO",
      "lastRotated": "2017-05-17T22:25:57.000Z",
      "nextRotation": "2017-08-15T22:25:57.000Z",
      "kid": "WYQxoK4XAwGFn5Zw5AzLxFvqEKLP79BbsKmWeuc5TB4"
    }
  },
  "_links": {
      "scopes": {
        "href": "https://dev-341069.oktapreview.com/api/v1/authorizationServers/ausain6z9zIedDCxB0h7/scopes",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      "claims": {
        "href": "https://dev-341069.oktapreview.com/api/v1/authorizationServers/ausain6z9zIedDCxB0h7/claims",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      "policies": {
        "href": "https://dev-341069.oktapreview.com/api/v1/authorizationServers/ausain6z9zIedDCxB0h7/policies",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      }
    },
    "self": {
      "href": "https:{yourOktaDomain}/api/v1/authorizationServers/ausain6z9zIedDCxB0h7",
      "hints": {
        "allow": [
          "GET",
          "DELETE",
          "PUT"
        ]
      }
    },
    "metadata": [
      {
        "name": "oauth-authorization-server",
        "href": "https://dev-341069.oktapreview.com/oauth2/ausain6z9zIedDCxB0h7/.well-known/oauth-authorization-server",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      {
        "name": "openid-configuration",
        "href": "https://dev-341069.oktapreview.com/oauth2/ausain6z9zIedDCxB0h7/.well-known/openid-configuration",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      }
    ],
    "rotateKey": {
      "href": "https://dev-341069.oktapreview.com/api/v1/authorizationServers/ausain6z9zIedDCxB0h7/credentials/lifecycle/keyRotate",
      "hints": {
        "allow": [
          "POST"
        ]
      }
    },
    "deactivate": {
          "href": "https://dev-341069.oktapreview.com/api/v1/authorizationServers/ausain6z9zIedDCxB0h7/lifecycle/deactivate",
          "hints": {
            "allow": [
              "POST"
        ]
      }
    }
  }
}

#2

Hello @vivekmohod,

Running the above JSON body through a validator (https://jsonlint.com/) returns the following:

Error: Parse error on line 90:
...POST"			]		}	}}}
------------------^
Expecting 'EOF', got '}' 

You have an extra closing bracket at the end of the file.

Thank you,
Andrei Hava
Developer Support Team


#3

Hi,

I have removed extra bracket from above JSON and getting below mentioned error response.

{
  "id": "0oafu4nt03Pyew3uS0h7",
  "name": "MyAuthorizationServer",
  "description": "MyAuthorizationServer",
  "audiences": "api://defaultNew",
  "issuer": "https://dev-974992.oktapreview.com/oauth2/default/0oafu4nt03Pyew3uS0h7",
  "issuerMode": "ORG_URL",
  "status": "ACTIVE",
  "created": "2018-08-10T22:25:57.000Z",
  "lastUpdated": "2018-08-10T22:25:57.000Z",
  "credentials": {
    "signing": {
      "rotationMode": "AUTO",
      "lastRotated": "2018-08-10T22:25:57.000Z",
      "nextRotation": "2018-08-10T22:25:57.000Z",
      "kid": "8Op6j0hDkWI39AGPXPGu9CR1_O0ZTfCW5C1_Zt1lwLU"
    }
  },
  "_links": {
      "scopes": {
        "href": "https://dev-974992.oktapreview.com/api/v1/authorizationServers/0oafu4nt03Pyew3uS0h7/scopes",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      "claims": {
        "href": "https://dev-974992.oktapreview.com/api/v1/authorizationServers/0oafu4nt03Pyew3uS0h7/claims",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      "policies": {
        "href": "https://dev-974992.oktapreview.com/api/v1/authorizationServers/0oafu4nt03Pyew3uS0h7/policies",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      }
    },
    "self": {
      "href": "https://dev-974992.oktapreview.com/api/v1/authorizationServers/0oafu4nt03Pyew3uS0h7",
      "hints": {
        "allow": [
          "GET",
          "DELETE",
          "PUT"
        ]
      }
    },
    "metadata": [
      {
        "name": "oauth-authorization-server",
        "href": "https://dev-974992.oktapreview.com/oauth2/0oafu4nt03Pyew3uS0h7/.well-known/oauth-authorization-server",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      },
      {
        "name": "openid-configuration",
        "href": "https://dev-974992.oktapreview.com/oauth2/0oafu4nt03Pyew3uS0h7/.well-known/openid-configuration",
        "hints": {
          "allow": [
            "GET"
          ]
        }
      }
    ],
    "rotateKey": {
      "href": "https://dev-974992.oktapreview.com/api/v1/authorizationServers/0oafu4nt03Pyew3uS0h7/credentials/lifecycle/keyRotate",
      "hints": {
        "allow": [
          "POST"
        ]
      }
    },
    "deactivate": {
          "href": "https://dev-974992.oktapreview.com/api/v1/authorizationServers/0oafu4nt03Pyew3uS0h7/lifecycle/deactivate",
          "hints": {
            "allow": [
              "POST"
        ]
      }
    }
  }

Response:

{
    "errorCode": "E0000011",
    "errorSummary": "Invalid token provided",
    "errorLink": "E0000011",
    "errorId": "oaexSvXMjsESX-UfQkZGBEIkA",
    "errorCauses": []
}

What token we have to pass to create authorization server?


#4

@ashish311patidar Please don’t post your question in multiple threads. I’ll answer yours here: Authorization Server Creation Issue


#5

@vivekmohod Did Andrei’s suggestion fix your problem?


#6

Yes, thanks for the help