external authentication with Oauth using OAuth2Authenticator results in invalid_request


I'm working on an app where I will hit my own backend (aspnet webapi) for authentication, using facebook, google etc. I'm testing against a default webapi project to get goinh, but ran into an issue. If I request the providers using Postman, I get the providers I've setup with some url's to reach them. But if I try to convert it into OAuth2Authenticator I get invalid_request. As far as I can see it has something to to with the redirect_url I provide.

The response when I request the providers looks like:

So when I setup OAuth2Authenticator I make something like this:
var auth = new OAuth2Authenticator (
clientId: "self", // your OAuth2 client id
scope: "", // the scopes for the particular API you're accessing, delimited by "+" symbols
authorizeUrl: new Uri (""), // the auth URL for the service
redirectUrl: new Uri ("")); // the redirect URL for the service

I also tried with the facebook clientId. For redirect I tried hitting both the raw url and then the html page.

Can anyone see where this breaks?

If I make a request with Postman to the provided url I get the correct result.

Best regards


Sign In or Register to comment.