FusionAuth
    • Home
    • Categories
    • Recent
    • Popular
    • Pricing
    • Contact us
    • Docs
    • Login
    1. Home
    2. jacob 0
    3. Best
    J
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 13
    • Best 2
    • Controversial 0
    • Groups 0

    Best posts made by jacob 0

    • RE: How do I call a Google API or retrieve the Google credentials?

      @mark-robustelli I made some headway in finding out when the token is blank!

      It seems that the first time that I make a sign in with Google, the token is returned every time.

      Any subsequent calls to get identity provider links may or may not return the token. The only way to guarentee it comes back is to completely "forget" the oauth2 link in accounts.google.com, specifically here: https://myaccount.google.com/connections.

      My solution is to save the token the first time it comes through in the database. There's one problem with this solution is that I don't have a refresh token for the user, so if this token expires I won't be able to refresh it, but I am only assuming that Fusion will refresh the token and return a new one for me. I have no idea if this is true or not.

      Since I can't see the source code of FusionAuth and the docs aren't clear about what kind of token this is, I can't say if this is going to work for sure.

      If you can give me more clarity into how this works

      posted in General Discussion
      J
      jacob 0
    • RE: How do I call a Google API or retrieve the Google credentials?

      @mark-robustelli I see now from here: that it is the refresh token, I see now that I should store the refresh token the first time and initially refresh that token to get an access token. Thank you @dan!

      IMHO this one tiny detail is not clear enough, even though it in there. For example, in the Link API it could mention again that the token is a refresh token. Instead it says this:

      This is treated as an opaque token as the type varies by identity provider, this value may not be returned by all identity providers. When provided, this token is typically a long lived access or refresh token, but consult individual identity provider documentation for specifics.

      That's not true though is it? It's a refresh token when one is available.

      While the details may be in the docs, IMHO it isn't extremely clear because OAuth is confusing for people in the first place, and FusionAuth is asking us to perform some but not all parts of the OAuth flow. The answer is spread throughout the docs. In the end if we want to create a custom login page with Google page we need to first:

      1. Create an OpenID for Identity Provider for Google.
      2. Create the Sign in Google URL on our own to call the sign in page.
      3. When the flow comes back to our page we need to exchange the code with the FusionAuth API.
      4. When that returns to our redirected url, we need to get the link API to get the refresh token in the token.
      5. Exchange that refresh token for an access token, and I guess refresh the token on our own?

      However, in a flow without FusionAuth we'd get the access token and refresh token together, store both, and use the access token until it is expired, then use the refresh token.

      While it is possible to figure this out, it's just not as clear as the rest of the docs. Everything up to this point was well written and clear. This was hard to figure out from my POV.

      posted in General Discussion
      J
      jacob 0