

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

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

Definition für einen OAuth 2.0-Authorizer, auch bekannt als JSON Web Token (JWT) -Authorizer.

Weitere Informationen finden Sie unter [Steuern des Zugriffs auf HTTP APIs mit JWT-Autorisierern](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-jwt-authorizer.html) im *API Gateway* Developer Guide.

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

Verwenden Sie die folgende Syntax, um diese Entität in Ihrer Vorlage AWS Serverless Application Model (AWS SAM) zu deklarieren.

### 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
```

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

 `AuthorizationScopes`   <a name="sam-httpapi-oauth2authorizer-authorizationscopes"></a>
Liste der Autorisierungsbereiche für diesen Autorisierer.  
*Typ*: Liste  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `IdentitySource`   <a name="sam-httpapi-oauth2authorizer-identitysource"></a>
Ausdruck der Identitätsquelle für diesen Autorisierer.  
*Typ:* Zeichenfolge  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig für AWS SAM und hat kein CloudFormation Äquivalent.

 `JwtConfiguration`   <a name="sam-httpapi-oauth2authorizer-jwtconfiguration"></a>
JWT-Konfiguration für diesen Autorisierer.  
Dies wird an den `jwtConfiguration` Abschnitt von und `x-amazon-apigateway-authorizer` im `securitySchemes` Abschnitt einer OpenAPI-Definition weitergegeben.  
Eigenschaften `issuer` und `audience` unterscheiden nicht zwischen Groß- und Kleinschreibung und können entweder in Kleinbuchstaben wie in OpenAPI oder in Großbuchstaben `Issuer` und wie in verwendet werden. `Audience` [AWS::ApiGatewayV2::Authorizer](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apigatewayv2-authorizer-jwtconfiguration.html) 
*Typ: Karte*  
*Required*: No  
*CloudFormation Kompatibilität*: Diese Eigenschaft ist einzigartig AWS SAM und hat kein CloudFormation Äquivalent.

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

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

OAuth Beispiel für einen 2.0-Authorizer

#### 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
```