How to get value of email form JWTHow can I prevent SQL injection in PHP?How do I get PHP errors to display?How do I get a YouTube video thumbnail from the YouTube API?How to Sort Multi-dimensional Array by Value?How to get the client IP address in PHPHow Do You Parse and Process HTML/XML in PHP?How do I check if a string contains a specific word?How does PHP 'foreach' actually work?JWT (JSON Web Token) automatic prolongation of expirationNode.js - How to use JWT token to Authenticate Mobile Firebase Users with Website Database?

Why escape if the_content isnt?

India just shot down a satellite from the ground. At what altitude range is the resulting debris field?

How to check is there any negative term in a large list?

What is the best translation for "slot" in the context of multiplayer video games?

How to safely derail a train during transit?

Unreliable Magic - Is it worth it?

A Rare Riley Riddle

Arithmetic mean geometric mean inequality unclear

Tiptoe or tiphoof? Adjusting words to better fit fantasy races

A problem in Probability theory

Anatomically Correct Strange Women In Ponds Distributing Swords

Why not increase contact surface when reentering the atmosphere?

How does Loki do this?

How to Reset Passwords on Multiple Websites Easily?

Inappropriate reference requests from Journal reviewers

How to pronounce the slash sign

Pole-zeros of a real-valued causal FIR system

Why didn't Theresa May consult with Parliament before negotiating a deal with the EU?

How does buying out courses with grant money work?

Implement the Thanos sorting algorithm

System.debug(JSON.Serialize(o)) Not longer shows full string

I'm in charge of equipment buying but no one's ever happy with what I choose. How to fix this?

How can a function with a hole (removable discontinuity) equal a function with no hole?

Term for the "extreme-extension" version of a straw man fallacy?



How to get value of email form JWT


How can I prevent SQL injection in PHP?How do I get PHP errors to display?How do I get a YouTube video thumbnail from the YouTube API?How to Sort Multi-dimensional Array by Value?How to get the client IP address in PHPHow Do You Parse and Process HTML/XML in PHP?How do I check if a string contains a specific word?How does PHP 'foreach' actually work?JWT (JSON Web Token) automatic prolongation of expirationNode.js - How to use JWT token to Authenticate Mobile Firebase Users with Website Database?













0















Im usign dialogflow to create a booking table assistant.
To get info by user, he need to sign in with google so when finish the conversation i would take uderId value of user.
For take that I use jose-php library so:



header( 'Access-Control-Allow-Headers: *' );
header( 'Access-Control-Allow-Origin: *' );
header( "Access-Control-Allow-Credentials: true" );
header( 'Content-Type: application/json' );

include('../phpseclib/Net/SSH2.php');
include('../JOSE/JWT.php');
include('../JOSE/URLSafeBase64.php');
$jwt_string = 'userIdtoken';
$jwt = JOSE_JWT::decode($jwt_string);
echo $jwt['JOSE_JWT']['Claims']['email'];


the problem is that I recive error printing email value!
How I could get it?



$jwt value result so:



JOSE_JWT Object
(
[header] => Array
(
[alg] => RS256
[kid] => cf022a49e9786148ad0e379cc854844e36c3edc1
[typ] => JWT
)

[claims] => Array
(
[iss] => https://accounts.google.com
[nbf] => 1551435957967
[aud] => 284549458086-fdoluk70pqkcuh8vj4tj1dou15v444tiua.apps.googleusercontent.com
[sub] => 1092379345381822971290339
[email] => dasdasddas@gmail.com
[email_verified] => 1
[name] => frank rossi
[picture] => https://lh4.googleusercontent.com/-79eVyjn_YU8/AAAAAAAAAAI/AAAAAAAAPBs/uvq_fruLiB0/s96-c/photo.jpg
[given_name] => Federico
[family_name] => Idsfdsfdsf
[iat] => 1545351958267
[exp] => 155143534961867
[jti] => 428254345532cddf49dec17d24ace2e6f45f8af4b14b2
)

[signature] => 'somthing'
[raw] => 'somthing'
)









share|improve this question


























    0















    Im usign dialogflow to create a booking table assistant.
    To get info by user, he need to sign in with google so when finish the conversation i would take uderId value of user.
    For take that I use jose-php library so:



    header( 'Access-Control-Allow-Headers: *' );
    header( 'Access-Control-Allow-Origin: *' );
    header( "Access-Control-Allow-Credentials: true" );
    header( 'Content-Type: application/json' );

    include('../phpseclib/Net/SSH2.php');
    include('../JOSE/JWT.php');
    include('../JOSE/URLSafeBase64.php');
    $jwt_string = 'userIdtoken';
    $jwt = JOSE_JWT::decode($jwt_string);
    echo $jwt['JOSE_JWT']['Claims']['email'];


    the problem is that I recive error printing email value!
    How I could get it?



    $jwt value result so:



    JOSE_JWT Object
    (
    [header] => Array
    (
    [alg] => RS256
    [kid] => cf022a49e9786148ad0e379cc854844e36c3edc1
    [typ] => JWT
    )

    [claims] => Array
    (
    [iss] => https://accounts.google.com
    [nbf] => 1551435957967
    [aud] => 284549458086-fdoluk70pqkcuh8vj4tj1dou15v444tiua.apps.googleusercontent.com
    [sub] => 1092379345381822971290339
    [email] => dasdasddas@gmail.com
    [email_verified] => 1
    [name] => frank rossi
    [picture] => https://lh4.googleusercontent.com/-79eVyjn_YU8/AAAAAAAAAAI/AAAAAAAAPBs/uvq_fruLiB0/s96-c/photo.jpg
    [given_name] => Federico
    [family_name] => Idsfdsfdsf
    [iat] => 1545351958267
    [exp] => 155143534961867
    [jti] => 428254345532cddf49dec17d24ace2e6f45f8af4b14b2
    )

    [signature] => 'somthing'
    [raw] => 'somthing'
    )









    share|improve this question
























      0












      0








      0








      Im usign dialogflow to create a booking table assistant.
      To get info by user, he need to sign in with google so when finish the conversation i would take uderId value of user.
      For take that I use jose-php library so:



      header( 'Access-Control-Allow-Headers: *' );
      header( 'Access-Control-Allow-Origin: *' );
      header( "Access-Control-Allow-Credentials: true" );
      header( 'Content-Type: application/json' );

      include('../phpseclib/Net/SSH2.php');
      include('../JOSE/JWT.php');
      include('../JOSE/URLSafeBase64.php');
      $jwt_string = 'userIdtoken';
      $jwt = JOSE_JWT::decode($jwt_string);
      echo $jwt['JOSE_JWT']['Claims']['email'];


      the problem is that I recive error printing email value!
      How I could get it?



      $jwt value result so:



      JOSE_JWT Object
      (
      [header] => Array
      (
      [alg] => RS256
      [kid] => cf022a49e9786148ad0e379cc854844e36c3edc1
      [typ] => JWT
      )

      [claims] => Array
      (
      [iss] => https://accounts.google.com
      [nbf] => 1551435957967
      [aud] => 284549458086-fdoluk70pqkcuh8vj4tj1dou15v444tiua.apps.googleusercontent.com
      [sub] => 1092379345381822971290339
      [email] => dasdasddas@gmail.com
      [email_verified] => 1
      [name] => frank rossi
      [picture] => https://lh4.googleusercontent.com/-79eVyjn_YU8/AAAAAAAAAAI/AAAAAAAAPBs/uvq_fruLiB0/s96-c/photo.jpg
      [given_name] => Federico
      [family_name] => Idsfdsfdsf
      [iat] => 1545351958267
      [exp] => 155143534961867
      [jti] => 428254345532cddf49dec17d24ace2e6f45f8af4b14b2
      )

      [signature] => 'somthing'
      [raw] => 'somthing'
      )









      share|improve this question














      Im usign dialogflow to create a booking table assistant.
      To get info by user, he need to sign in with google so when finish the conversation i would take uderId value of user.
      For take that I use jose-php library so:



      header( 'Access-Control-Allow-Headers: *' );
      header( 'Access-Control-Allow-Origin: *' );
      header( "Access-Control-Allow-Credentials: true" );
      header( 'Content-Type: application/json' );

      include('../phpseclib/Net/SSH2.php');
      include('../JOSE/JWT.php');
      include('../JOSE/URLSafeBase64.php');
      $jwt_string = 'userIdtoken';
      $jwt = JOSE_JWT::decode($jwt_string);
      echo $jwt['JOSE_JWT']['Claims']['email'];


      the problem is that I recive error printing email value!
      How I could get it?



      $jwt value result so:



      JOSE_JWT Object
      (
      [header] => Array
      (
      [alg] => RS256
      [kid] => cf022a49e9786148ad0e379cc854844e36c3edc1
      [typ] => JWT
      )

      [claims] => Array
      (
      [iss] => https://accounts.google.com
      [nbf] => 1551435957967
      [aud] => 284549458086-fdoluk70pqkcuh8vj4tj1dou15v444tiua.apps.googleusercontent.com
      [sub] => 1092379345381822971290339
      [email] => dasdasddas@gmail.com
      [email_verified] => 1
      [name] => frank rossi
      [picture] => https://lh4.googleusercontent.com/-79eVyjn_YU8/AAAAAAAAAAI/AAAAAAAAPBs/uvq_fruLiB0/s96-c/photo.jpg
      [given_name] => Federico
      [family_name] => Idsfdsfdsf
      [iat] => 1545351958267
      [exp] => 155143534961867
      [jti] => 428254345532cddf49dec17d24ace2e6f45f8af4b14b2
      )

      [signature] => 'somthing'
      [raw] => 'somthing'
      )






      php jwt dialogflow






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 13:08









      DigitalXPDigitalXP

      87415




      87415






















          1 Answer
          1






          active

          oldest

          votes


















          0














          It seems to me like the problem is a typo. You wrote $jwt['JOSE_JWT']['Claims']['email'];, but the key is claims, not Claims.



          Also, $jwt seems to be an object of class JOSE_JWT, not an array. So using it with subscript operator is not possible just like that. You should instead access its properties:



          $jwt->claims['email']





          share|improve this answer

























          • the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

            – DigitalXP
            Mar 7 at 13:17











          • see my edit, please

            – Victor
            Mar 7 at 13:19











          • ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

            – DigitalXP
            Mar 7 at 13:26












          • What do you mean by “not decoded”? What is the output?

            – Victor
            Mar 7 at 13:27












          • something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

            – DigitalXP
            Mar 7 at 13:32










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55044578%2fhow-to-get-value-of-email-form-jwt%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          It seems to me like the problem is a typo. You wrote $jwt['JOSE_JWT']['Claims']['email'];, but the key is claims, not Claims.



          Also, $jwt seems to be an object of class JOSE_JWT, not an array. So using it with subscript operator is not possible just like that. You should instead access its properties:



          $jwt->claims['email']





          share|improve this answer

























          • the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

            – DigitalXP
            Mar 7 at 13:17











          • see my edit, please

            – Victor
            Mar 7 at 13:19











          • ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

            – DigitalXP
            Mar 7 at 13:26












          • What do you mean by “not decoded”? What is the output?

            – Victor
            Mar 7 at 13:27












          • something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

            – DigitalXP
            Mar 7 at 13:32















          0














          It seems to me like the problem is a typo. You wrote $jwt['JOSE_JWT']['Claims']['email'];, but the key is claims, not Claims.



          Also, $jwt seems to be an object of class JOSE_JWT, not an array. So using it with subscript operator is not possible just like that. You should instead access its properties:



          $jwt->claims['email']





          share|improve this answer

























          • the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

            – DigitalXP
            Mar 7 at 13:17











          • see my edit, please

            – Victor
            Mar 7 at 13:19











          • ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

            – DigitalXP
            Mar 7 at 13:26












          • What do you mean by “not decoded”? What is the output?

            – Victor
            Mar 7 at 13:27












          • something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

            – DigitalXP
            Mar 7 at 13:32













          0












          0








          0







          It seems to me like the problem is a typo. You wrote $jwt['JOSE_JWT']['Claims']['email'];, but the key is claims, not Claims.



          Also, $jwt seems to be an object of class JOSE_JWT, not an array. So using it with subscript operator is not possible just like that. You should instead access its properties:



          $jwt->claims['email']





          share|improve this answer















          It seems to me like the problem is a typo. You wrote $jwt['JOSE_JWT']['Claims']['email'];, but the key is claims, not Claims.



          Also, $jwt seems to be an object of class JOSE_JWT, not an array. So using it with subscript operator is not possible just like that. You should instead access its properties:



          $jwt->claims['email']






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 7 at 13:19

























          answered Mar 7 at 13:13









          VictorVictor

          5,5691246105




          5,5691246105












          • the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

            – DigitalXP
            Mar 7 at 13:17











          • see my edit, please

            – Victor
            Mar 7 at 13:19











          • ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

            – DigitalXP
            Mar 7 at 13:26












          • What do you mean by “not decoded”? What is the output?

            – Victor
            Mar 7 at 13:27












          • something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

            – DigitalXP
            Mar 7 at 13:32

















          • the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

            – DigitalXP
            Mar 7 at 13:17











          • see my edit, please

            – Victor
            Mar 7 at 13:19











          • ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

            – DigitalXP
            Mar 7 at 13:26












          • What do you mean by “not decoded”? What is the output?

            – Victor
            Mar 7 at 13:27












          • something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

            – DigitalXP
            Mar 7 at 13:32
















          the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

          – DigitalXP
          Mar 7 at 13:17





          the response is Fatal error: Cannot use object of type JOSE_JWT as array in xxxx.php on line 13 and the line 13 is the last echo

          – DigitalXP
          Mar 7 at 13:17













          see my edit, please

          – Victor
          Mar 7 at 13:19





          see my edit, please

          – Victor
          Mar 7 at 13:19













          ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

          – DigitalXP
          Mar 7 at 13:26






          ok this dont get error, but the output is not decoded....why? Because if make print_r($jwt) I see the array that I wrote

          – DigitalXP
          Mar 7 at 13:26














          What do you mean by “not decoded”? What is the output?

          – Victor
          Mar 7 at 13:27






          What do you mean by “not decoded”? What is the output?

          – Victor
          Mar 7 at 13:27














          something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

          – DigitalXP
          Mar 7 at 13:32





          something like that: eyJhbGciOiJSUzI1NiIsImtpZCI6ImNmMDIyYTQ5ZTk3ODYxNDhhZDBlMzc5Y2M4NTQ4NDRlMzZjM2VkYzEiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJo

          – DigitalXP
          Mar 7 at 13:32



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55044578%2fhow-to-get-value-of-email-form-jwt%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

          Алба-Юлія

          Захаров Федір Захарович