locked
Google Authentication is requiring a registered domain on some test project RRS feed

  • Question

  • User-540818677 posted

    I have created asp.net mvc5 web project, I have enabled GoogleAuthtication by un-commenting the following inside the Startup.Auth.CS:-

    app.UseGoogleAuthentication();

    now I have create a project on the following environment:-

    1. Visual studio 2012 professional.
    2. Asp.net mvc5 web application.
    3. Running on windows server 2008 R2.

    And the Google authntication works well on my test project runs locally http://localhost:53357.

    Yesterday I wanted to test the new Visual Studio 2013, so I download Visual Studio 2013 express on my windows 7 machine,, and I created a new asp.net mvc5 web project. But when I try to test the Google authentication I got the following error on google page:-

     

    400. That’s an error.
    
     
    
    OpenID auth request contains an unregistered domain: http://localhost:53682
    
     
    
    Learn more
    
    That’s all we know.

    So why google authentication works well on certain projects and fail to work on other?

    Please adivce

    Thursday, June 19, 2014 7:49 AM

Answers

  • User1779161005 posted

    The google authentication middleware supports the older OpenID protocol and the newer OpenID Connect protocol (yea, confusing names). The older protocol was disabled in the past week or so from google, so those APIs are basically useless now. Use the newer GoogleOAuth2AuthenticationOptions for the newer OpenID Connect protocol.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 19, 2014 10:19 AM

All replies

  • User1779161005 posted

    The google authentication middleware supports the older OpenID protocol and the newer OpenID Connect protocol (yea, confusing names). The older protocol was disabled in the past week or so from google, so those APIs are basically useless now. Use the newer GoogleOAuth2AuthenticationOptions for the newer OpenID Connect protocol.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 19, 2014 10:19 AM
  • User-540818677 posted

    Use the newer GoogleOAuth2AuthenticationOptions for the newer OpenID Connect protocol.

    can you adivce how i can add this new authntication inside my as.net mvc 5 project?

    Thursday, June 19, 2014 12:42 PM
  • User1779161005 posted

    I'd check the docs on asp.net for the new katana authentication middleware.

    Thursday, June 19, 2014 3:14 PM
  • User-1454326058 posted

    Hi john,

    For your requirement, you could refer to:

    # Code! MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on

    http://www.asp.net/mvc/tutorials/mvc-5/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on

    The code will be like this:

     app.UseGoogleAuthentication(
             clientId: "464895986072-3n36bh547si2sj2srdvuckdn07kmuj25.apps.googleusercontent.com",
             clientSecret: "BZUF7Tea8TsxslQJgUEdGZi-");

    Thanks

    Best Regards

    Friday, June 20, 2014 1:29 AM