Implement new method for code request token generation

It should be working now, although it would be nice to have more testing