I am working on a project with play framework 2.5 which provides API service for developers.
I now want to implement access token with play framework in order to control the access of the server APIs.
I have implemented app key and app secret already. Can anyone please advices how to generate the access tokens?
答案 0 :(得分:1)
使用JavaWebTokens(jwt),它将始终为您提供唯一的密钥,
var arr = [
{'status':'ok'},
{'status':'ok'},
{'status':'error'}
]
var arr2 = [
{'status':error, 'msg': 'etc', 'more property':true}
]
arr = arr.forEach(obj => { if(obj.status === 'error'){obj = arr2[i]} return obj })