Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upAuthorizer/Cognito documentation lacking #563
Comments
This comment has been minimized.
This comment has been minimized.
|
Yep. You could write a chalice app like this using the from chalice import Chalice, Response
app = Chalice(app_name='redirect')
@app.route('/')
def index():
return Response(
status_code=301,
headers={'Location': '<my-oauth-page>'},
body=''
)Let us know if that helps. |
kyleknap
added
closing-soon-if-no-response
question
labels
Oct 4, 2017
This comment has been minimized.
This comment has been minimized.
|
Yes that makes sense for general Oauth. But I'm talking about AWS Cognito. Can't we streamline the solution a bit more. Would be nice if I could just return a one liner that redirects user to Cognito Oauth and get's the appropriate keys. I'd like to build an app with Chalice with some semblance of User Management. Where users could login/create account, save data, and display it. Thought I would be able to do this with Cognito... |
This comment has been minimized.
This comment has been minimized.
|
Here's what I'm looking for:
|
jamesls
removed
the
closing-soon-if-no-response
label
Oct 9, 2017
jamesls
self-assigned this
Oct 9, 2017
kyleknap
removed
the
question
label
Oct 16, 2017
This comment has been minimized.
This comment has been minimized.
wollerman
commented
Oct 17, 2017
|
I agree the documentation is lacking on how to use Cognito. I think part of the confusion is because of the distinction between using Chalice for web based API access and the expectation of Chalice endpoints being used in the middle of a workflow that already has something like a Cognito JWT. So to hopefully give an example of what I've gotten to work, my current approach has been to setup a test user and run something like:
I think Chalice was meant to be placed into a workflow. By supporting the Cognito authorizer it allows for endpoints to be protected and return an appropriate API result based on the request. @jamesls correct me if I've misspoke! |
JordonPhillips
assigned
JordonPhillips
and unassigned
jamesls
Oct 23, 2017
This comment has been minimized.
This comment has been minimized.
wollerman
commented
Oct 27, 2017
•
|
@nitrag another example of using Cognito is in the Ionic AWS Starter. They give a lot of nice setup for getting a session. Then you can access the token directly and make API calls with
The Cognito SDK documentation is definitely lacking. Hopefully these quick examples of what worked for me will help others. Like I mentioned previously, Chalice makes the backend services extremely easy to implement, integrate with Cognito, and deploy. It's the rest of the spaghetti I've found unclear :D |
kyleknap
assigned
jamesls
and unassigned
JordonPhillips
Nov 6, 2017
This comment has been minimized.
This comment has been minimized.
|
I agree we should get our documentation updated. There's nothing in chalice right now that generates login pages for you. That functionality is provided by cognito user pools directly, but we may be able to make that easier. As for as the cognito user pools authorizer, @wollerman is correct. The authorizer requires the jwt id token from the login process to be provided in the Auth header. I typically use https://github.com/aws/amazon-cognito-identity-js/ (and its Labeling this as documentation, we'll get our docs updated. |
jamesls
added
the
documentation
label
Nov 16, 2017
tleyden
referenced this issue
Feb 16, 2018
Closed
Need help with Cognito user pool authentication + session cookie best practices #717
This comment has been minimized.
This comment has been minimized.
josephpconley
commented
Jan 24, 2019
|
Updating link to active repo https://github.com/aws-amplify/amplify-js/tree/master/packages/amazon-cognito-identity-js |


nitrag commentedOct 3, 2017
I'm using the Cognito authorizer:
https://github.com/aws/chalice#using-amazon-cognito-user-pools
I'm at a loss on how to authenticate. Surely there should be an easy one-liner for a web redirect to an OAUTH page for users to signup/login?