ADFS 3.0 access from AWS Lambda using OAuth2

I've been googling for a week to no avail: I'm trying to access a Dynamics CRM (On Premise, ADFS 3.0) web service from a AWS Lambda function, with the OAuth2 redirect URI being another Lambda via the AWS API Gateway, but ADFS doesn't appear to like my redirect (localhost works fine). Any idea if what I'm trying to do is even possible? Another post mentioned using "Identity Server" which I'm going to explore but for all I know it will be another dead end.