Our mobile application uses unauthenticated cognito flow to authorize devices. We use Oauth authentication for our backend which expects a bearer token. to get this bearer token, instead of saving clientid/secret on the client we are planning to call api gateway for that cognito user pool and then proxy into oauth service provider which would return a bearer token. Client would use this bearer token to make further backend calls.
We tested the http proxy and it is working great from api gateway console. Issue we are running into is with the authorizer. Our authorization mechanism is cognito user pool. So to test the authorizer, console asks for a identity token. We are not sure what identity token is. Tried to test with cognitoId, openToken obtained by aws iOS sdk for unauthenticated cognito user, none of them works. The message from the logs is "Unauthorized request:"
Could someone please suggest a solution?