

# x-amazon-apigateway-authtype 속성
<a name="api-gateway-swagger-extensions-authtype"></a>

REST API의 경우 이 확장을 사용하여 Lambda 권한 부여자의 사용자 지정 유형을 정의할 수 있습니다. 이 경우 값은 자유 형식입니다. 예를 들어 API에는 서로 다른 내부 스키마를 사용하는 여러 Lambda 권한 부여자가 있을 수 있습니다. 이 확장을 사용하여 Lambda 권한 부여자의 내부 스키마를 식별할 수 있습니다.

보다 일반적으로 HTTP API 및 REST API에서는 동일한 보안 스키마를 공유하는 여러 작업에서 IAM 권한 부여를 정의하는 방법으로 사용할 수도 있습니다. 이 경우 용어 `awsSigv4`은(는) 접두사 `aws`이(가) 붙은 용어와 함께 예약 용어입니다.

이 확장은 [OpenAPI 2](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/2.0.md#security-scheme-object) 및 [OpenAPI 3](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.1.md#security-scheme-object)의 `apiKey` 유형 보안 스키마에 적용됩니다.

## x-amazon-apigateway-authtype 예제
<a name="api-gateway-swagger-extensions-authtype-example"></a>

다음 OpenAPI 3 예제는 REST API 또는 HTTP API의 여러 리소스에 대한 IAM 권한 부여를 정의합니다.

```
{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "openapi3",
    "version" : "1.0"
  },
  "paths" : {
    "/operation1" : {
      "get" : {
        "responses" : {
          "default" : {
            "description" : "Default response"
          }
        },
        "security" : [ {
          "sigv4Reference" : [ ]
        } ]
      }
    },
    "/operation2" : {
      "get" : {
        "responses" : {
          "default" : {
            "description" : "Default response"
          }
        },
        "security" : [ {
          "sigv4Reference" : [ ]
        } ]
      }
    }
  },
  "components" : {
    "securitySchemes" : {
      "sigv4Reference" : {
        "type" : "apiKey",
        "name" : "Authorization",
        "in" : "header",
        "x-amazon-apigateway-authtype": "awsSigv4"
      }
    }
  }
}
```

다음 OpenAPI 3 예제는 REST API에 대한 사용자 지정 스키마를 사용하여 Lambda 권한 부여자를 정의합니다.

```
{
  "openapi" : "3.0.1",
  "info" : {
    "title" : "openapi3 for REST API",
    "version" : "1.0"
  },
  "paths" : {
    "/protected-by-lambda-authorizer" : {
      "get" : {
        "responses" : {
          "200" : {
            "description" : "Default response"
          }
        },
        "security" : [ {
          "myAuthorizer" : [ ]
        } ]
      }
    }
  },
  "components" : {
    "securitySchemes" : {
      "myAuthorizer" : {
        "type" : "apiKey",
        "name" : "Authorization",
        "in" : "header",
        "x-amazon-apigateway-authorizer" : {
          "identitySource" : "method.request.header.Authorization",
          "authorizerUri" : "arn:aws:apigateway:us-east-1:lambda:path/2015-03-31/functions/arn:aws:lambda:us-east-1:account-id:function:function-name/invocations",
          "authorizerResultTtlInSeconds" : 300,
          "type" : "request",
          "enableSimpleResponses" : false
        },
        "x-amazon-apigateway-authtype": "Custom scheme with corporate claims"
      }
    }
  },
  "x-amazon-apigateway-importexport-version" : "1.0"
}
```

## 다음 사항도 참조하세요.
<a name="api-gateway-swagger-extensions-authtype-see-also"></a>

[authorizer.authType](https://docs.aws.amazon.com/apigateway/latest/api/API_Authorizer.html#apigw-Type-Authorizer-authType)