Create authorizer
    • PDF

    Create authorizer

    • PDF

    Article summary

    Available in Classic and VPC

    Create an authorizer that can be used as an authentication method when using APIs.

    Request

    The following describes the request format for the endpoint. The request format is as follows:

    MethodURI
    POST/authorizers

    Request headers

    For headers common to API Gateway, see API Gateway common request headers.

    Request syntax

    The request syntax is as follows.

    {
      "authorizerName" : "authorizerName",
      "authorizerConfig" : {
        "functionId" : "functionId",
        "payload" : [ {
          "in" : "HEADER",
          "name" : "name"
        } ],
        "region" : "region"
      },
      "authorizerType" : "CLOUD_FUNCTIONS",
      "authorizerDescription" : "authorizerDescription"
    }
    

    Request body

    The following describes the request body.

    FieldTypeRequiredDescription
    authorizerNameStringRequiredName of authorizer to create
    • 1 to 20 characters, including English letters, numbers, and special characters "_" and "-"
    authorizerConfigObjectRequiredConfiguration information for the authorizer to create
    authorizerConfig.functionIdStringRequiredFunction name of the service (type) to be supported by the authorizer to create
    • <E.g.> Action name of the Cloud Functions service
    authorizerConfig.payload[]StringRequiredSelect the request type (header or query string) and enter a variable name for passing to the authorizer for authentication processing
    authorizerConfig.payload[].inStringRequiredType of payload to specify
    • HEADER | QUERY STRING
      • HEADER: header
      • QUERY STRING: query string
    authorizerConfig.payload[].nameStringRequiredPayload variable name
    authorizerConfig.regionStringRequiredSelect a region with support services (type) for the authorizer to create
    authorizerTypeStringRequiredSelect a support service (type) for the authorizer
    authorizerDescriptionStringOptionalEnter a description for the authorizer to create
    • 0 - 300 characters

    Request example

    The following is a sample request.

    curl -X POST 'https://apigateway.apigw.ntruss.com/api/v1/authorizers' \
    --header 'Content-Type: application/json' \
    --header 'x-ncp-apigw-timestamp: {Timestamp}' \
    --header 'x-ncp-iam-access-key: {Access Key}' \
    --header 'x-ncp-apigw-signature-v2: {API Gateway Signature}'
    --data '{
      "authorizerName" : "author-***",
      "authorizerConfig" : {
        "functionId" : "functionId",
        "payload" : [ {
          "in" : "HEADER",
          "name" : "payload-***"
        } ],
        "region" : "region"
      },
      "authorizerType" : "CLOUD_FUNCTIONS",
      "authorizerDescription" : "authorizer-*** Description"
    }'
    

    Response

    The following describes the response format.

    Response syntax

    The syntax is as follows.

    {
        "authorizerId": "authorizerId",
        "tenantId": "tenantId",
        "authorizerName": "authorizerName",
        "authorizerDescription": "authorizerDescription",
        "authorizerType": "authorizerType",
        "authorizerConfig": {
            "region": "region",
            "functionId": "functionId",
            "payload": [
                {
                    "in": "in",
                    "name": "name"
                }
            ]
        },
        "modifier": "modifier",
        "domainCode": "domainCode",
        "modTime": "2024-05-03T01:26:57Z"
    }
    

    Response status codes

    For response status codes common to API Gateway, see API Gateway response status codes.

    Response example

    The following is a sample response.

    {
        "authorizerId": "***yddjd2m",
        "tenantId": "***4402f55ae4436913a6e2c65bab47c",
        "authorizerName": "authorizer-***",
        "authorizerDescription": "authorizer-*** Description",
        "authorizerType": "CLOUD_FUNCTIONS",
        "authorizerConfig": {
            "region": "KR",
            "functionId": "***/***",
            "payload": [
                {
                    "in": "HEADER",
                    "name": "payload-***"
                }
            ]
        },
        "modifier": "d12c9fd0-****-****-****-246e96591a38",
        "domainCode": "PUB",
        "modTime": "2024-05-03T01:26:57Z"
    }
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.