Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 01, 2016 @ 07:50
    Nguyen Dung Tri
    0

    Is there a package of Gmail login for Umbraco CMS?

    Hi,

    I'm starting to develop a package that can help user to login to Umbraco CMS using their Gmail account. Is there a package for Umbraco CMS to do that?

  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Aug 01, 2016 @ 09:01
    Kevin Jump
    1

    Hi

    from Umbraco 7.4+ Backoffice (so the CMS) uses OWIN so you can already do this with back end users.

    https://umbraco.com/follow-us/blog-archive/2016/7/26/log-into-umbraco-with-google-authentication/

    for members (people logging on to your site) its a bit more complex but there are Identity packages/ github repos where people have done this.

    I Just need to remember who did that....

  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 02, 2016 @ 07:28
    Nguyen Dung Tri
    0

    Hi Kevin,

    I have follow the instruction of Log into Umbraco with Google authentication but stuck at how to show Link your google account button on admin page:

    enter image description here

    And Sign in with Google button on login page:

    enter image description here

    There is no document for how to do those steps.

  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Aug 02, 2016 @ 07:50
    Kevin Jump
    0

    Hi

    have you checked the two links snook in at the very bottom of that post ?

    Note: The "Link your Google account" button has a bug in Umbraco 7.4 and 7.5 beta which can be fixed as follows:

    In Umbraco 7.4.x, update the "externalLoginForm" in the file ~\Umbraco\Views\common\dialogs\user.html

    In Umbraco 7.5 beta/beta2 update the "externalLoginForm" in the file ~\Umbraco\Views\common\overlays\user\user.html

    I missed them the first time i went through it.

  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 02, 2016 @ 08:04
    Nguyen Dung Tri
    0

    Hi,

    After all, I have misunderstand at these lines from the document:

    var clientId = WebConfigurationManager.AppSettings["GoogleOAuthClientID"];
    var secret = WebConfigurationManager.AppSettings["GoogleOAuthSecret"];
    app.ConfigureBackOfficeGoogleAuth(clientId, secret);
    

    Actually, these lines must add to file App_Start\UmbracoStandardOwinStartup.cs as follow:

    enter image description here

    Note: GoogleOAuthSecret and GoogleOauthSecret are from Web.Config

    enter image description here

  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 02, 2016 @ 09:31
    Nguyen Dung Tri
    0

    Hi Kevin,

    When I click on the link Sign in with Google and get accepted from Gmail. When it redirect back to http://localhost:59521/umbraco-google-signin, still I cannot login to my Umbraco Site. Please see the picture:

    enter image description here

  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Aug 02, 2016 @ 12:34
    Kevin Jump
    0

    Hi

    in the default setup , i think you have to first login with an umbraco user, then in that users settings (click on the user logo in the top left) associate with google.

    or you can do the thing the do in the post which is restrict it to the domain.

    also if it's still not working you might get an error in the tracelog (app_data/logs/umbracotracelog.txt)

  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 02, 2016 @ 14:14
    Nguyen Dung Tri
    0

    Hi Kevin,

    What function/method from with class will it call when Google redirect to http://localhost:59521/umbraco-google-signin? So I can debug and know how to fix things.

    Currently, I got these message from log file:

     2016-08-02 21:13:18,432 [P12680/D2/T212] ERROR Umbraco.Core.Logging.OwinLogger - Event Id: 0, state: Authentication failed
    System.Net.Http.HttpRequestException: Response status code does not indicate success: 403 (Forbidden).
       at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
       at Microsoft.Owin.Security.Google.GoogleOAuth2AuthenticationHandler.<AuthenticateCoreAsync>d__0.MoveNext()
    
  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Aug 02, 2016 @ 14:35
    Kevin Jump
    1

    Hi

    the code for the Umbraco Identity stuff is here https://github.com/Shazwazza/UmbracoIdentity

    reading around, i think your error is coming from google thowing the 403. A slightly older thread (pre UmbracoIdentity stuff) https://our.umbraco.org/forum/developers/extending-umbraco/67041-umbraco-730-identity-provider-cant-get-google-oauth-to-work has a couple of things -

    reading to the end, the first thing i would confim is that the account in google has Google+API enabled.

    from the google console, you should see the google+ api on the list of APIs your project

    enter image description here

    but if it's not that - then that previous thread has some steps you could look at for checking code. (but remember they are from before UmbracoIdentity package was released)

  • Nguyen Dung Tri 106 posts 606 karma points
    Aug 03, 2016 @ 02:36
    Nguyen Dung Tri
    0

    Hi Kevin,

    I have followed your guild and suggestion links, but still I'm stuck at Google API return to authentication link as "https". So my localhost website cannot process further. Do you know how to solve this issue?

  • Kevin Jump 2348 posts 14896 karma points MVP 9x c-trib
    Aug 01, 2016 @ 09:18
    Kevin Jump
    0

    Hi

    OWIN for front end members -

    https://github.com/Shazwazza/UmbracoIdentity

    this will let you plug google (and any OAuth) provider in.

    Kevin

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies