Class AwsProxySecurityContext

java.lang.Object
com.amazonaws.serverless.proxy.internal.jaxrs.AwsProxySecurityContext
All Implemented Interfaces:
jakarta.ws.rs.core.SecurityContext

public class AwsProxySecurityContext extends Object implements jakarta.ws.rs.core.SecurityContext
default implementation of the SecurityContext object. This class supports 3 API Gateway's authorization methods: AWS_IAM, CUSTOM_AUTHORIZER, and COGNITO_USER_POOL (oidc). The Principal returned by the object depends on the authorization model: * AWS_IAM: User ARN * CUSTOM_AUTHORIZER: Custom user principal * COGNITO_USER_POOL: Cognito identity id
  • Constructor Details

    • AwsProxySecurityContext

      public AwsProxySecurityContext(com.amazonaws.services.lambda.runtime.Context lambdaContext, AwsProxyRequest event)
  • Method Details

    • getLambdaContext

      public com.amazonaws.services.lambda.runtime.Context getLambdaContext()
    • getEvent

      public AwsProxyRequest getEvent()
    • getUserPrincipal

      public Principal getUserPrincipal()
      Specified by:
      getUserPrincipal in interface jakarta.ws.rs.core.SecurityContext
    • isUserInRole

      public boolean isUserInRole(String role)
      Specified by:
      isUserInRole in interface jakarta.ws.rs.core.SecurityContext
    • isSecure

      public boolean isSecure()
      Specified by:
      isSecure in interface jakarta.ws.rs.core.SecurityContext
    • getAuthenticationScheme

      public String getAuthenticationScheme()
      Specified by:
      getAuthenticationScheme in interface jakarta.ws.rs.core.SecurityContext