Cognito Authorization not working locally?

Hi, I can deploy and get 401 errors but when I run jets locally it gives a 200 response. When I remove the authorizers i get a 200 on both my local and dev environments


class OrdersController < ApplicationController

authorizer "main#my_cognito"


class MainAuthorizer < ApplicationAuthorizer
name: "MyCognito", # <= name is used as the "function" name
identity_source: "Authorization", # maps to method.request.header.Authorization
type: :cognito_user_pools,
provider_arns: [
  # no lambda function

Also is there a way to define a userpool per environment?

You can probably do it with Shared Resources

But wouldn’t recommend it. Cognitio Pools have state, like a database. So wouldn’t couple it with the Jets app. IE: You delete the Jets app, you’ll delete the Cognito Pool or database. Jets apps are probably better stateless. Define the Cognito Pool outside of the Jets.

1 Like