Browse through the questions and answers listed below or filter and sort to narrow down your results.
0
answers
0
votes
8
views
asked 22 days ago
Question about writing a Cognito post-auth lambda in go
I wrote a really simple post-auth lambda for cognito like this:
```go
func HandleRequest(ctx context.Context, e events.CognitoEventUserPoolsPostAuthentication ) error {
eventJson, _ := json.MarshalIndent(e, "", " ")
eventString := strings.ReplaceAll(string(eventJson), "\n", "\r")
log.Printf("EVENT: %s", eventString)
return nil
}
func main() {
lambda.Start(HandleRequest)
}
```
It's only there - for now - to log activity. But when I actually attach it to the user pool as a post-authentication trigger it makes OAuth2 not work. The error message is "contact administrator."
I'm thinking that I need to actually do something besides return error = nil. I'm not having much luck finding any examples of this in go, though.
The javascript example ends with:
```
// Return to Amazon Cognito
callback(null, event);
```
Is that what the expectation is in 'go' as well - that I return `(events.CognitoEventUserPoolsPostAuthentication, error)` and just send it back the original event?
Accepted AnswerAmazon Cognito
1
answers
0
votes
14
views
asked a month ago
1
answers
0
votes
36
views
asked a month ago
1
answers
0
votes
35
views
asked 3 months ago
0
answers
0
votes
5
views
asked 3 months ago
Java, JS, Android/Ios example about PKCE code grant flow extension
Hi guys,
I am researching topics about Cognito. I know how works the Authorization Code Grant Flow with Cognito. But I'm interested on how works the PKCE extension, more specifically how can I develop this extension with a Java example, or it's integrated with the Cognito SDK for Java ?, I would also appreciate other examples in Javascript and/or Android/IOS examples about PKCE. Thanks in advance !
Greetings.
Accepted AnswerAmazon Cognito
2
answers
0
votes
10
views
asked 3 months ago
1
answers
0
votes
22
views
asked 3 months ago
1
answers
0
votes
21
views
asked 3 months ago
Cognito questions
Hi guys,
I've working with Amazon Cognito and I've a doubt, for example: if I've working with a server side applications (Authorization Code Grant Flow) and a user logged in the app, then
Cognito send him an id token and access token. With these tokens the app can access to some resources, but here is my question:
Can we check the tokens in my server side app, that is, can we check if the token if correctly formed, signed an have the correct claims before the server side app answer the request ?, and
have we to do all of this for each request ?, thanks in advance !
Greetings.
Accepted AnswerAmazon Cognito
1
answers
0
votes
20
views
asked 3 months ago
Cognito Java examples
Hi guys,
I'm a new user in this forum, I've been working with Cognito last months. I've found some examples in Java, but I like to explore others.
Can you give me some example that working with Cognito in Java ?, thanks in advance !
Greetings.
Accepted AnswerAmazon Cognito
1
answers
0
votes
9
views
asked 3 months ago