2021年5月8日星期六

How can i get refreshtoken from headers when i use node.js?

I have two accesstoken and refreshtoken in authorization.

The one in front is the accesstoken and the one in the back is the refreshtoken. Getting the accesstoken in front was successful, how can I filter out the refreshtoken?

this is headers

headers: {                  authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjE3MjA2OTc4MzciLCJpYXQiOjE2MjA0NTkzMTYsImV4cCI6MTYyMDQ1OTMyMX0.eYTj0L2g6Z1BM7C-EmtJUXWw9l_t5ua59-w5ZQrvTfU             //this is refreshtoken  //          eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjE3MjA2OTc4MzciLCJpYXQiOjE2MjA0NTkzMTYsImV4cCI6MTYyMDQ1OTQzNn0.8rl3avx3eL7DhxCgu1kUTqYr_f2fjNs7o-ZxEUTsKs8',  }  

Getting the accesstoken in front was successful, like this

        const authHeader = req.headers["authorization"];          const token = authHeader && authHeader.split(" ")[1];          console.log("token::::::::", token);            //success get accesstoken  

then how can i get refreshtoken?

i want to get refreshtoken like this

console.log(refreshtoken)  eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjE3MjA2OTc4MzciLCJpYXQiOjE2MjA0NTkzMTYsImV4cCI6MTYyMDQ1OTQzNn0.8rl3avx3eL7DhxCgu1kUTqYr_f2fjNs7o-ZxEUTsKs8  
https://stackoverflow.com/questions/67445223/how-can-i-get-refreshtoken-from-headers-when-i-use-node-js May 08, 2021 at 03:44PM

没有评论:

发表评论