Giter Club home page Giter Club logo

Comments (8)

Fleker avatar Fleker commented on July 21, 2024

Just to confirm, the first snippet does work as expected?

from actions-on-google-java.

 avatar commented on July 21, 2024

Yes, this works:

String accessToken = ((DialogflowRequest)request).getAogRequest().getUser().getAccessToken();
but as it's been discovered via some deep debugging sessions and not really advertised anywhere, I'm cautious about using it as it may break in the future in case of impl change.

And this doesn't work: request.getUser().getIdToken()=null

Should it not return consistent results?

from actions-on-google-java.

aradwyr avatar aradwyr commented on July 21, 2024

Check out the Google Sign In sample in Java but specifically here:

  private boolean userIsSignedIn(ActionRequest request) {
    String idToken = request.getUser().getIdToken();
    LOGGER.info(String.format("Id token: %s", idToken));
    if (idToken == null || idToken.isEmpty()) {
      return false;
    } else {
      return true;
    }
  }

I'm closing this out but if you're still facing issues let us know.

from actions-on-google-java.

 avatar commented on July 21, 2024

@sarahdwyer I saw that, but it doesn't address the issue I'm experiencing

from actions-on-google-java.

taycaldwell avatar taycaldwell commented on July 21, 2024

Did you set up Account Linking for your project? If so, what configuration did you choose (Google Sign-In, OAuth, etc.)?

from actions-on-google-java.

 avatar commented on July 21, 2024

We did via OAuth's Authorization code flow

from actions-on-google-java.

morphine9 avatar morphine9 commented on July 21, 2024

@slkasisto if you added OAuth, then user info needs to come from your authentication/authorization provider. The access token you get back from request.getUser().getAccessToken() is the access token to your oauth provider

from actions-on-google-java.

 avatar commented on July 21, 2024

That is understood, however it was not populating.

from actions-on-google-java.

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.