How implement Jwt signature

I need to generate a jwt to get a token, I am not able to generate the signature based on the header and payload generated in base64, there is some specific active, how can I be generating this jwt