Skip to content

Cognito auth#33

Draft
drekdrek wants to merge 14 commits intocs399f24:mainfrom
drekdrek:cognito
Draft

Cognito auth#33
drekdrek wants to merge 14 commits intocs399f24:mainfrom
drekdrek:cognito

Conversation

@drekdrek
Copy link
Collaborator

This implements a bare-bones cognito auth flow.

@drekdrek drekdrek mentioned this pull request Nov 20, 2024
@jpappel
Copy link
Collaborator

jpappel commented Nov 20, 2024

will this eventually implement something similar to a @login_required decorator?

@drekdrek
Copy link
Collaborator Author

i rebased this branch to main for the changes made in #34, hence the force-push

@jpappel
Copy link
Collaborator

jpappel commented Nov 21, 2024

why were the decorators removed in 9828529, doing so causes the non-AWS deploys to fail.

If there is an issue of making a request to often for the configuration value, it can be cached by doing something like

@property
def SOME_VAL():
    if self._SOME_VAL is None:
        self._SOME_VAL = value_generator()
    return self._SOME_VAL

@jpappel
Copy link
Collaborator

jpappel commented Nov 21, 2024

Upon looking further inspection, removing the properties is what caused the tests to fail

@drekdrek
Copy link
Collaborator Author

drekdrek commented Nov 22, 2024

I removed the properties because the cognito library would not end up getting the value, and got a property object instead

example:
AWS_COGNITO_DOMAIN https://bingomaker.auth.us-east-1.amazoncognito.com
AWS_COGNITO_LOGOUT_URL https://bingo.drek.cloud/postlogout
AWS_COGNITO_REDIRECT_URL https://bingo.drek.cloud/postlogin
AWS_COGNITO_REFRESH_COOKIE_AGE_SECONDS 86400
AWS_COGNITO_REFRESH_COOKIE_ENCRYPTED True
AWS_COGNITO_REFRESH_FLOW_ENABLED True
AWS_COGNITO_USER_POOL_CLIENT_ID <property object at 0x1059fa160>
AWS_COGNITO_USER_POOL_CLIENT_SECRET <property object at 0x1059fa110>
AWS_COGNITO_USER_POOL_ID <property object at 0x1059fa200>
AWS_REGION us-east-1

so when logging in the client_id is client_id=%3Cproperty+object+at+0x1059fa160%3E (url encoded)

@jpappel
Copy link
Collaborator

jpappel commented Nov 23, 2024

Is this still waiting on anything?

@drekdrek drekdrek mentioned this pull request Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants