Skip to content
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

AWS ALB support for built-in authentication #7773

Closed
kamaz opened this issue May 25, 2020 · 4 comments · Fixed by #7780
Closed

AWS ALB support for built-in authentication #7773

kamaz opened this issue May 25, 2020 · 4 comments · Fixed by #7780
Assignees
Labels
cat/aws-event-alb deprecation Deprecation proposal (breaking with next major) enhancement

Comments

@kamaz
Copy link
Contributor

kamaz commented May 25, 2020

At the moment ALB event only support two options allow and deny but there is no option to configure built-in authentication in ALBs.

Use case description

Ability to utilise the ALB and cognito feature to built-in authentication support for in ALBs.

Proposed solution

Extend the existing logic:

auth.onUnauthenticatedRequest = auth.allowUnauthenticated ? 'allow' : 'deny';

To add a new field for backward compatibility e.g. authenticationMode to support the following options:

  • allow
  • deny
  • authenticate

if both fields authenticationMode and allowUnauthenticated are defined return an error.

Reference Link

https://aws.amazon.com/blogs/aws/built-in-authentication-in-alb/

@medikoo
Copy link
Contributor

medikoo commented May 26, 2020

@kamaz great thanks for proposal. It'll definitely be a worthwhile addition. One question.

Will setting authenticate to onUnauthenticatedRequest be all that's needed to configure
built-in authentication? Or will (or may) it need and additional configuration for its fine tuning?

@kamaz
Copy link
Contributor Author

kamaz commented May 26, 2020

@medikoo

When it comes to cognito that is the only change required. Of course, there are other types supported like oidc which I'm not sure about. But looking into AWS CloudFormation documentation values are common between both of them.

Link to oidc and cognito CloudFormation:

And example condition:

{
    "Type": "authenticate-cognito",
    "AuthenticateCognitoConfig": {
        "UserPoolArn": "arn:aws:cognito-idp:eu-west-2:******:userpool/*****",
        "UserPoolClientId": "******",
        "UserPoolDomain": "******",
        "SessionCookieName": "AWSELBAuthSessionCookie",
        "Scope": "openid",
        "SessionTimeout": 604800,
        "AuthenticationRequestExtraParams": {},
        "OnUnauthenticatedRequest": "authenticate"
    },
    "Order": 1
}

@medikoo
Copy link
Contributor

medikoo commented May 26, 2020

I suggest that we introduce onUnauthenticatedRequest and support three options 'allow', 'deny' (default as it is now) and 'authenticate'.

In case both (onUnauthenticatedRequest and allowUnauthenticated) are provided. I would silently favor onUnauthenticatedRequest, but I would also deprecate allowUnauthenticated to not support two different ways to achieve same thing.

We've introduced deprecations handling with #7422, first implemented example can be found here: #7759

What do you think?

@kamaz
Copy link
Contributor Author

kamaz commented May 26, 2020

Yes, that sounds good. I should have something ready today for initial review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat/aws-event-alb deprecation Deprecation proposal (breaking with next major) enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants