

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

# OAuth2Authorizer
<a name="sam-property-httpapi-oauth2authorizer"></a>

JSON Web トークン (JWT) オーソライザーとしても知られる OAuth 2.0 オーソライザーの定義です。

詳細については、*API Gateway デベロッパーガイド*の「[JWT オーソライザーを使用した HTTP API へのアクセスの制御](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html)」を参照してください。

## 構文
<a name="sam-property-httpapi-oauth2authorizer-syntax"></a>

 AWS Serverless Application Model (AWS SAM) テンプレートでこのエンティティを宣言するには、次の構文を使用します。

### YAML
<a name="sam-property-httpapi-oauth2authorizer-syntax.yaml"></a>

```
  [AuthorizationScopes](#sam-httpapi-oauth2authorizer-authorizationscopes): List
  [IdentitySource](#sam-httpapi-oauth2authorizer-identitysource): String
  [JwtConfiguration](#sam-httpapi-oauth2authorizer-jwtconfiguration): Map
```

## プロパティ
<a name="sam-property-httpapi-oauth2authorizer-properties"></a>

 `AuthorizationScopes`   <a name="sam-httpapi-oauth2authorizer-authorizationscopes"></a>
このオーソライザーの認可スコープのリストです。  
*タイプ*: リスト  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `IdentitySource`   <a name="sam-httpapi-oauth2authorizer-identitysource"></a>
このオーソライザーのアイデンティティソース式です。  
*タイプ*: 文字列  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

 `JwtConfiguration`   <a name="sam-httpapi-oauth2authorizer-jwtconfiguration"></a>
このオーソライザーの JWT 設定です。  
これは、OpenAPI 定義の `securitySchemes` セクションにある `x-amazon-apigateway-authorizer` の `jwtConfiguration` セクションに渡されます。  
プロパティ `issuer` と `audience` は大文字と小文字を区別せず、OpenAPI のように小文字を使用することも、[ AWS::ApiGatewayV2::Authorizer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-authorizer-jwtconfiguration.html) のように大文字の `Issuer` および `Audience` を使用することもできます。
*タイプ*: マップ  
*必須:* いいえ  
*CloudFormation 互換性*: このプロパティは に固有 AWS SAM であり、 CloudFormation 同等のものはありません。

## 例
<a name="sam-property-httpapi-oauth2authorizer--examples"></a>

### OAuth 2.0 オーソライザー
<a name="sam-property-httpapi-oauth2authorizer--examples--oauth-2.0-authorizer"></a>

OAuth 2.0 オーソライザーの例

#### YAML
<a name="sam-property-httpapi-oauth2authorizer--examples--oauth-2.0-authorizer--yaml"></a>

```
Auth:
  Authorizers:
    OAuth2Authorizer:
      AuthorizationScopes:
        - scope1
      JwtConfiguration:
        issuer: "https://www.example.com/v1/connect/oauth2"
        audience:
          - MyApi
      IdentitySource: "$request.querystring.param"
  DefaultAuthorizer: OAuth2Authorizer
```