openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
├── src | |
│ ├── main | |
│ │ ├── java | |
│ │ │ └── com | |
│ │ │ └── example | |
│ │ │ ├── adapters | |
│ │ │ │ ├── controllers | |
│ │ │ │ │── database | |
│ │ │ │ │ ├── postgresql # Implementation for PostgreSQL | |
│ │ │ │ │ │ ├── entities # PostgreSQL entity classes |
Since it's been days, I am guessing this was solved. I am just adding my two cents here for future readers. | |
The problem lies with the JwtModule and the JwtStrategy instantiation. They aren't configured properly. | |
You need to pass in the algorithms you'd use for signing and verifying the tokens, along with the keys. | |
To verify whether the tokens are actually getting generated with the RS256 algo, check the header in the token at https://jwt.io/. | |
It would probably show HS256, and since your code didn't use the correct algorithm to sign the token. | |
And it fails while token gets verified using the public key. | |
To generate signed tokens properly with the RSA key pair: |
openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
require('crypto').randomBytes(48, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); }); |
// check version | |
node -v || node --version | |
// list locally installed versions of node | |
nvm ls | |
// list remove available versions of node | |
nvm ls-remote | |
// install specific version of node |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
People
![]() :bowtie: |
😄 :smile: |
😆 :laughing: |
---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"