-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom authorizer for AWS AppSync #2
Comments
Having reviewed the related issue, I believe our use case sits under this requirement. Context:
Our solution: The sticking point: In an ideal world we would like the AppSync Managed Service to allow us to configure two OIDC providers when using OPENID_CONNECT as the security type. Failing this, we would like the 'plumbing' for a custom authorizer to be part of the service to simplify our deployment process and remove the need for us to send an API Key in the request as well. Potential solution (just my thoughts..) There is much detail here and it would be interesting to know how others have attempted to solve this Custom Auth issue in lieu of it being integrated into the AppSync Managed Service. We have an Enterprise Support argeement with AWS and so I will inform our Technical Account Manager of this issue too in the event you would like to discuss this in a private forum to fully understand our use-case. |
I think it would make sense to mimic the API Gateway Lambda authorizer approach. Incoming requests trigger a Lambda that responds with an IAM policy. AppSync would assume that policy when handling this request. It's basically AWS IAM authentication but the policy is returned from Lambda instead of based on who signs the request. You can also pass back additional information that will be available as part of the |
An important part of the API Gateway Lambda/Custom Authorizer implementation is the ability to set a context which is passed as part of the users identity. In SaaS apps this provides an opportunity to efficiently load user permissions once at the start of the request instead of needing to reload them in every resolver. Example: We store the context = {
"tenant1": { "canRead": true, "canUpdate": true },
"tenant2": { "canRead": true, "canUpdate": false }
} In the resolver template I could use the This is partly related to #9. |
@appwiz The video isn't up yet but I'll attach a link when it is. I spent a lot of time looking into SaaS user models a few months ago and concluded that there are three common models:
The first model is really simple to implement and well supported today. Both models 2 and 3 can have complex permissions models. Model 2 can be implemented today with some effort but model 3 requires custom authorizers. At piiq we currently use model 2. Application level permissions like support or admin that I give to piiq staff use Cognito User Pool groups but tenant permissions are stored in DynamoDB. I'm happy to provide more details about this and the challenges we've had offline. Suffice to say, it would make life easier if we could use a custom authorizer to load tenant permissions once per request. |
I also need exactly this solution. Our basic architecture is derived from this AWS sample project: |
@appwiz The video I mentioned is now available at https://anz-resources.awscloud.com/aws-summit-sydney-2019-build/securing-saas-applications-built-on-serverless-microservices-3. |
We need this as well. |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
This feature would be hugely useful, we are exploring unifying some legacy apis behind appsync. Our internal users would be fairly easy to port over into cognito, but we have a class of internal users that have alternate logins (PIN codes) for some kiosk style apps which would require some custom authentication but would follow the same permission group structure as the full login users. |
Do we have a tentative release date for this? This would be really useful!! Thank you everyone. |
Please allow custom authorizer with lambda. Also, why does every example of appsync include amplify and cognito user pools? Anyone have any examples using authentication other than user pools? Using aws cdk, no amplify, and apollo react on client. |
+4 |
I guess this is already supported? https://aws.amazon.com/blogs/mobile/appsync-custom-auth/ |
The problem there (IMHO) is that you still need to use the API Keys which are not very flexible. |
@dusan-dragon it's still not supported :( |
Hi all, @awsed announced last week that this is, in fact, coming! I can't share timelines with you (yet), but stay tuned 😄 |
+1 |
Any news on this? Looking forward to seeing this happen! :) |
Any update is greatly appreciated. I would like to know the status on this as well. Thanks! |
hi, im starting out with Appsync + Cognito.. my plan was to have one AWS account at our Org level that holds our cognito. I was planning to hold users in that user pool, and have that cognito be the authorizer for Appsync in multiple other accounts. I've been searching for a while for "cross account cognito appsync" and was lead here. It seems like this is not possible at this time until this feature on this issue is added? My appsync api seems to work with the "cross cognito" if I set it to ALLOW, which appears that it would let any Cognito token work, which is obviously not what I want. |
+1. this is blocking us as well |
hey @Liooo, thank you we actually ended up doing something similar. For us it's a bit more complicated because we are using amplify as well and then the whole thing snowballs not just appsync. Eventually we created a 2nd cognito pool and connected that to the "main" pool through OIDC. It works well, however it's definitely an extra layer and plus cost. |
+1 |
Any news on this? Huge blocker. |
We just launched Lambda Auth support for AppSync. You can find details in the docs: https://docs.aws.amazon.com/appsync/latest/devguide/security-authz.html#aws-lambda-authorization Thank you all for the feedback. |
Hi, does this new feature have any performance improvements over the pipeline resolver method? |
Customers have expressed interest in a custom authorizer for AWS AppSync where they can configure a custom lambda to authorize requests.
See related issue:
#1
The text was updated successfully, but these errors were encountered: