Good afternoon, I'm having a problem implementing external login in a project I'm working on.
ASP.NET Web API + Owin + OAuth.
Environment: I work with two Server1 and Server2 servers.
Server1: Server published on the WEB. It hosts files (HTML, CSS, JS). In addition, it functions as a proxy. All incoming calls (which are not called files) are redirected to Server2.
Server2: Unpublished server. Receives calls only on Server1. This server hosts a WEB API and is the one where the user must be authenticated.
Problem: When logging in to Server2, Owin returns the following parameter as redirect_uri:
&redirect_uri=http://server2/signin-google
Since the parameter I need to return would be:
&redirect_uri=http://server1/signin-google
The only setting I found was CallbackPath:
googleAuthOptions = new GoogleOAuth2AuthenticationOptions() {
ClientId = "xxxxxxx",
ClientSecret = "xxxxxxx",
CallbackPath = new PathString("/path"),
Provider = new GoogleAuthProvider()
};
But this setting does not work since new PathString("http://server1/signin-google")
is not a valid value.
Does anyone know how I solve this problem?