4

Im working on asp mvc 5 with google oauth login, I followed a tutorial installing owin security and set the google redirect url to be localhost/myapp/signin-google,

my question is where can i change the localhost/myapp/signin-google to be something else like localhost/myapp/mycallback ?

i tried change is to be localhost/myapp/signup/ExternalLoginCallback which the actual action, but it didnt work, is 'signin-google' hardcoded in owin security??

Kevin Simple
  • 1,225
  • 10
  • 22

1 Answers1

4

Adem is right. Here is how you change it:

var options = new GoogleOAuth2AuthenticationOptions
{
    ClientId = "Your Client ID",
    ClientSecret = "Your Client Secret",
    CallbackPath = new PathString("/myapp/mycallback")
};
app.UseGoogleAuthentication(options);

Please see this link for more details.

halfer
  • 19,824
  • 17
  • 99
  • 186
Soma Yarlagadda
  • 2,875
  • 3
  • 15
  • 37
  • ta , this is a text length fixer – Kevin Simple May 04 '16 at 21:59
  • Hello! I would like to ask how do I have to set the CallbackPath when I am working in localhost? It always return me to the page that I have login but I want to return at the home page. Thank you – touinta May 20 '16 at 07:21
  • With callbackpath you are setting only the relative path. The domain stays the same. So please add the relative path to your home page to CallbackPath variable. – Soma Yarlagadda May 20 '16 at 07:24