Giter Club home page Giter Club logo

Comments (9)

JeffWeim avatar JeffWeim commented on July 21, 2024

@soupette

First, I've found that the issue was simply not having the Google+ API enable. I feel like for the development env, there needs to be much better debug messaging enabled. This was a simple issue to fix, but there was nothing indicating what needed to happen.

Second, I'm now receiving another message in the client. It is happening on the redirect back from Google to the app. The message reads:

{
   "jwt":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MywiaWF0IjoxNTIzNjQwNjYyLCJleHAiOjE1MjYyMzI2NjJ9.Lp0bELpbJaYqSC6YSj1PNIyXHzYWVhvF4GrDxAiItJY",
   "user":{
      "id":3,
      "username":"[email protected]",
      "email":"[email protected]",
      "provider":"google",
      "role":{
         "id":3,
         "name":"Public",
         "description":"Default role given to unauthenticated user.",
         "type":"public"
      },
      "updated_at":null,
      "created_at":null
   }
}

I'm not sure why at this point the client isn't returning to the app (I'd expect it to be going to http://localhost:3000/) in a logged-in state. Instead the url is pointing to: http://localhost:1337/auth/google/callback?access_token=...

from strapi-examples.

soupette avatar soupette commented on July 21, 2024

I think that you'll find answer in this documentation.

Let me know if you're still struggling

from strapi-examples.

JeffWeim avatar JeffWeim commented on July 21, 2024

@soupette

If I follow the steps in those docs, I'm continually redirected back to Google account selection page (ie https://accounts.google.com/signin/oauth/oauthchooseaccount...)

I'm confused as to why in the docs for the "The redirect URL to your front-end app" section it says to use connect/google, while the default value in the admin is auth/google/callback.

Neither of the values seem to work

Also, I'm pretty sure the base url used for "The redirect URL to your front-end app" is wrong. In the docs it is http://locahost:3000/... (strapi.remoteURL) while in the admin it's configured to http://localhost:1337/... (strapi.backendURL). Which one is correct?

my default admin settings:
admin

from strapi-examples.

soupette avatar soupette commented on July 21, 2024

If you're using the boilerplate provided in the examples it's http://locahost:3000/connect/google.

You're right, the url writtent in the admin is wrong but if you click on the field you'll see that it will automatically change to auth/google/callback so you need to edit this field in the admin.

from strapi-examples.

JeffWeim avatar JeffWeim commented on July 21, 2024

I am using the boilerplate provider, which uses http://locahost:3000/ and that seems all good.

What I am saying, is that the Strapi admin code running at http://locahost:1337/ is in fact using this exact same base url for the "The redirect URL to your front-end app" section. I can click to change the auth/google/callback portion, but that is not the problem. The problem is base url for this section is in fact http://locahost:1337/ and not http://locahost:3000/ as you mentioned it should be (and this cannot be changed):

This is a screenshot from my local development admin server:
strapi-admin

Beyond this issue, I don't understand why there is a feature in the admin to prevent a admin from changing the base url (unless it's not a feature...)? It is very likely other developers will not be developing at http://locahost:3000/ and would want to change this.

from strapi-examples.

soupette avatar soupette commented on July 21, 2024

Well the redirect URL of your front-end app can be changed, However the one that manages the authentication between your api and your provider cannot be modified since it's dynamic, so if you change the port of your API the field will also be updated

from strapi-examples.

JeffWeim avatar JeffWeim commented on July 21, 2024

Hmm alright. So how is it in this documentation you were able to set both http://locahost:3000 and http://localhost:1337?

admin_google_conf

This is what I'm most confused about.

from strapi-examples.

nabiltkarim avatar nabiltkarim commented on July 21, 2024

@JeffWeim facing the same issues here while trying to integrating it with my strapi admin. Any clues as to what values you put as redirect URL in your provider?

from strapi-examples.

pronvd7 avatar pronvd7 commented on July 21, 2024

you need to make google process firstly from frontend app after that response add to the strapi backend server

from strapi-examples.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.