• GitHub
  • Documentation
  • Discord
  • Tip
search
  • chevron_right Threads
  • label Integrations

Activating Social OAUTH 2.0 Google

thamel
Dec. 6, 2023
chat_bubble_outline 6
  • check_circle
  • link
    thamel
    Members 3 posts
    Dec. 6, 2023, 11:55 a.m. Dec. 6, 2023, 11:55 a.m.
    link

    Hi!
    Trying to get GOODLE OAUTH social integration to work using version 0.38.1 release. No matter what I do I get the same error message from google.

    See attached. I have played with the URIs. Any hint regarding those? I took them from the urls.py file.

    urlpatterns = [
        path("oauth2/login/", oauth2_login, name="oauth2-login"),
        path("oauth2/complete/", oauth2_complete, name="oauth2-complete"),
    ]
    

    Have you been able to get google integration working with misago with the latest release?

    Thanks!
    Tim

    Screenshot 2023-12-06 at 12.42.50.png

    PNG, 162.4 KB, uploaded by thamel on Dec. 6, 2023.

    Screenshot 2023-12-06 at 12.44.08.png

    PNG, 111.5 KB, uploaded by thamel on Dec. 6, 2023.

  • arrow_forward

    Thread has been moved from Support.

    • By rafalp on Dec. 6, 2023, 12:01 p.m..
  • link
    rafalp
    Project Lead 2027 posts
    Dec. 6, 2023, 12:03 p.m. Dec. 6, 2023, 12:03 p.m.
    link

    Hi. Are you using Misago's OAuth2 client, or Social login for Google?

    In first case, you should only define a single redirect URI:

    https://actionenergycommunity.com/oauth2/complete/ (note the trailing slash)

  • link
    thamel
    Members 3 posts
    Dec. 6, 2023, 1:50 p.m. Dec. 6, 2023, 1:50 p.m.
    link

    Hi,

    edit: Ok, just found your code for socialauth in the dev folder... sorry did not look at that before. Will use those URIs...

    No we are using your social login...

    I was trying your preset social login for Google. Tried all variations of the redirect uri... including just one, both, with and without single slash. Is the social login not based on oauth ? I added the client ID and client secret I generated at google...

    We also want the twitter/X and Facebook login...

    THANKS.

  • link
    rafalp
    Project Lead 2027 posts
    Dec. 6, 2023, 2:08 p.m. Dec. 6, 2023, 2:08 p.m.
    link
    check_box

    Marked as best answer by Dec. 6, 2023, 4:52 p.m..

    https://actionenergycommunity24.com/oauth2/complete/ is only for generic OAuth2 client.

    Social login url is https://actionenergycommunity24.com/complete/google-oauth2/

    Documentation: misago.gitbook.io/docs/socialauth

    thamel likes this.

    favorite 1

  • edit

    Thread title has been changed from OAUTH 2.0 Google.

    • By thamel on Dec. 6, 2023, 4:57 p.m..
  • link
    rafalp
    Project Lead 2027 posts
    Dec. 6, 2023, 5:30 p.m. Dec. 6, 2023, 5:30 p.m.
    link

    I think admin control panel should communicate it that in addition to OAuth 2 client social auth way for configuring extra login options exist. And we could expose redirect url in those settings forms as quick reference for users.

    thamel likes this.

    favorite 1

  • link
    thamel
    Members 3 posts
    Dec. 6, 2023, 5:41 p.m. Dec. 6, 2023, 5:41 p.m.
    link

    That would be cool. Was complete oversight by me.

    What are the expected url path set for django for facebook and twitter/x?

    FB: …../complete/facebook/
    X: …/complete/twitter/

    For FB I found this on Stackoverflow:
    “ I've spent hours on this issue, but it turns out I only needed to do this Valid OAuth Redirect URIs set to www.domain.ext/social/complete/facebook/
    Note the www.“

    And from your doc
    Different providers have different requirements for 3rd party apps. For example, Facebook Login requires app authors to meet following requirements to create app in Facebook for developers:
    Site is reachable from internet and uses https
    You need to provide link to Privacy Policy used by your site
    Your callback URL needs to be explicit and contain /complete/facebook/ in it to pass validation

  • link
    rafalp
    Project Lead 2027 posts
    Dec. 6, 2023, 5:48 p.m. Dec. 6, 2023, 5:48 p.m.
    link
    @thamel has written:

    FB: …../complete/facebook/
    X: …/complete/twitter/

    Yes. The syntax is /complete/{PROVIDER_ID}/, and you can get PROVIDER_ID from admin url, eg:

    /admincp/settings/social-auth/edit/google-oauth2/ is a form for google-oauth2 social auth provider.

    thamel likes this.

    favorite 1

arrow_upward Go to top
  • This site uses cookies to gather statistical data for use in traffic analysis.
  • GitHub
  • Documentation
  • Discord
  • Tip
  • Terms of service
  • Privacy policy
powered by misago