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 "[email protected]"